mirror of
https://github.com/immich-app/immich.git
synced 2025-07-19 22:44:24 +02:00
feat(server): visibility column (#17939)
* feat: private view * pr feedback * sql generation * feat: visibility column * fix: set visibility value as the same as the still part after unlinked live photos * fix: test * pr feedback
This commit is contained in:
parent
016d7a6ceb
commit
d33ce13561
90 changed files with 1137 additions and 867 deletions
server/test
|
@ -5,7 +5,7 @@ import { createHash, randomBytes } from 'node:crypto';
|
|||
import { Writable } from 'node:stream';
|
||||
import { AssetFace } from 'src/database';
|
||||
import { AssetJobStatus, Assets, DB, FaceSearch, Person, Sessions } from 'src/db';
|
||||
import { AssetType, SourceType } from 'src/enum';
|
||||
import { AssetType, AssetVisibility, SourceType } from 'src/enum';
|
||||
import { ActivityRepository } from 'src/repositories/activity.repository';
|
||||
import { AlbumRepository } from 'src/repositories/album.repository';
|
||||
import { AssetJobRepository } from 'src/repositories/asset-job.repository';
|
||||
|
@ -227,16 +227,37 @@ const getRepositoryMock = <K extends keyof RepositoryMocks>(key: K) => {
|
|||
|
||||
case 'database': {
|
||||
return automock(DatabaseRepository, {
|
||||
args: [undefined, { setContext: () => {} }, { getEnv: () => ({ database: { vectorExtension: '' } }) }],
|
||||
args: [
|
||||
undefined,
|
||||
{
|
||||
setContext: () => {},
|
||||
},
|
||||
{ getEnv: () => ({ database: { vectorExtension: '' } }) },
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
case 'email': {
|
||||
return automock(EmailRepository, { args: [{ setContext: () => {} }] });
|
||||
return automock(EmailRepository, {
|
||||
args: [
|
||||
{
|
||||
setContext: () => {},
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
case 'job': {
|
||||
return automock(JobRepository, { args: [undefined, undefined, undefined, { setContext: () => {} }] });
|
||||
return automock(JobRepository, {
|
||||
args: [
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
{
|
||||
setContext: () => {},
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
|
||||
case 'logger': {
|
||||
|
@ -345,11 +366,11 @@ const assetInsert = (asset: Partial<Insertable<Assets>> = {}) => {
|
|||
type: AssetType.IMAGE,
|
||||
originalPath: '/path/to/something.jpg',
|
||||
ownerId: '@immich.cloud',
|
||||
isVisible: true,
|
||||
isFavorite: false,
|
||||
fileCreatedAt: now,
|
||||
fileModifiedAt: now,
|
||||
localDateTime: now,
|
||||
visibility: AssetVisibility.TIMELINE,
|
||||
};
|
||||
|
||||
return {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue