mirror of
				https://github.com/immich-app/immich.git
				synced 2025-10-31 13:57:39 +09: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:
		| @@ -413,11 +413,10 @@ export type AssetMediaCreateDto = { | ||||
|     duration?: string; | ||||
|     fileCreatedAt: string; | ||||
|     fileModifiedAt: string; | ||||
|     isArchived?: boolean; | ||||
|     isFavorite?: boolean; | ||||
|     isVisible?: boolean; | ||||
|     livePhotoVideoId?: string; | ||||
|     sidecarData?: Blob; | ||||
|     visibility?: AssetVisibility; | ||||
| }; | ||||
| export type AssetMediaResponseDto = { | ||||
|     id: string; | ||||
| @@ -427,11 +426,11 @@ export type AssetBulkUpdateDto = { | ||||
|     dateTimeOriginal?: string; | ||||
|     duplicateId?: string | null; | ||||
|     ids: string[]; | ||||
|     isArchived?: boolean; | ||||
|     isFavorite?: boolean; | ||||
|     latitude?: number; | ||||
|     longitude?: number; | ||||
|     rating?: number; | ||||
|     visibility?: AssetVisibility; | ||||
| }; | ||||
| export type AssetBulkUploadCheckItem = { | ||||
|     /** base64 or hex encoded sha1 hash */ | ||||
| @@ -470,12 +469,12 @@ export type AssetStatsResponseDto = { | ||||
| export type UpdateAssetDto = { | ||||
|     dateTimeOriginal?: string; | ||||
|     description?: string; | ||||
|     isArchived?: boolean; | ||||
|     isFavorite?: boolean; | ||||
|     latitude?: number; | ||||
|     livePhotoVideoId?: string | null; | ||||
|     longitude?: number; | ||||
|     rating?: number; | ||||
|     visibility?: AssetVisibility; | ||||
| }; | ||||
| export type AssetMediaReplaceDto = { | ||||
|     assetData: Blob; | ||||
| @@ -815,13 +814,11 @@ export type MetadataSearchDto = { | ||||
|     deviceId?: string; | ||||
|     encodedVideoPath?: string; | ||||
|     id?: string; | ||||
|     isArchived?: boolean; | ||||
|     isEncoded?: boolean; | ||||
|     isFavorite?: boolean; | ||||
|     isMotion?: boolean; | ||||
|     isNotInAlbum?: boolean; | ||||
|     isOffline?: boolean; | ||||
|     isVisible?: boolean; | ||||
|     lensModel?: string | null; | ||||
|     libraryId?: string | null; | ||||
|     make?: string; | ||||
| @@ -844,7 +841,7 @@ export type MetadataSearchDto = { | ||||
|     "type"?: AssetTypeEnum; | ||||
|     updatedAfter?: string; | ||||
|     updatedBefore?: string; | ||||
|     withArchived?: boolean; | ||||
|     visibility?: AssetVisibility; | ||||
|     withDeleted?: boolean; | ||||
|     withExif?: boolean; | ||||
|     withPeople?: boolean; | ||||
| @@ -888,13 +885,11 @@ export type RandomSearchDto = { | ||||
|     createdAfter?: string; | ||||
|     createdBefore?: string; | ||||
|     deviceId?: string; | ||||
|     isArchived?: boolean; | ||||
|     isEncoded?: boolean; | ||||
|     isFavorite?: boolean; | ||||
|     isMotion?: boolean; | ||||
|     isNotInAlbum?: boolean; | ||||
|     isOffline?: boolean; | ||||
|     isVisible?: boolean; | ||||
|     lensModel?: string | null; | ||||
|     libraryId?: string | null; | ||||
|     make?: string; | ||||
| @@ -911,7 +906,7 @@ export type RandomSearchDto = { | ||||
|     "type"?: AssetTypeEnum; | ||||
|     updatedAfter?: string; | ||||
|     updatedBefore?: string; | ||||
|     withArchived?: boolean; | ||||
|     visibility?: AssetVisibility; | ||||
|     withDeleted?: boolean; | ||||
|     withExif?: boolean; | ||||
|     withPeople?: boolean; | ||||
| @@ -923,13 +918,11 @@ export type SmartSearchDto = { | ||||
|     createdAfter?: string; | ||||
|     createdBefore?: string; | ||||
|     deviceId?: string; | ||||
|     isArchived?: boolean; | ||||
|     isEncoded?: boolean; | ||||
|     isFavorite?: boolean; | ||||
|     isMotion?: boolean; | ||||
|     isNotInAlbum?: boolean; | ||||
|     isOffline?: boolean; | ||||
|     isVisible?: boolean; | ||||
|     language?: string; | ||||
|     lensModel?: string | null; | ||||
|     libraryId?: string | null; | ||||
| @@ -949,7 +942,7 @@ export type SmartSearchDto = { | ||||
|     "type"?: AssetTypeEnum; | ||||
|     updatedAfter?: string; | ||||
|     updatedBefore?: string; | ||||
|     withArchived?: boolean; | ||||
|     visibility?: AssetVisibility; | ||||
|     withDeleted?: boolean; | ||||
|     withExif?: boolean; | ||||
| }; | ||||
| @@ -1877,18 +1870,18 @@ export function getRandom({ count }: { | ||||
|         ...opts | ||||
|     })); | ||||
| } | ||||
| export function getAssetStatistics({ isArchived, isFavorite, isTrashed }: { | ||||
|     isArchived?: boolean; | ||||
| export function getAssetStatistics({ isFavorite, isTrashed, visibility }: { | ||||
|     isFavorite?: boolean; | ||||
|     isTrashed?: boolean; | ||||
|     visibility?: AssetVisibility; | ||||
| }, opts?: Oazapfts.RequestOpts) { | ||||
|     return oazapfts.ok(oazapfts.fetchJson<{ | ||||
|         status: 200; | ||||
|         data: AssetStatsResponseDto; | ||||
|     }>(`/assets/statistics${QS.query(QS.explode({ | ||||
|         isArchived, | ||||
|         isFavorite, | ||||
|         isTrashed | ||||
|         isTrashed, | ||||
|         visibility | ||||
|     }))}`, { | ||||
|         ...opts | ||||
|     })); | ||||
| @@ -3242,9 +3235,8 @@ export function tagAssets({ id, bulkIdsDto }: { | ||||
|         body: bulkIdsDto | ||||
|     }))); | ||||
| } | ||||
| export function getTimeBucket({ albumId, isArchived, isFavorite, isTrashed, key, order, personId, size, tagId, timeBucket, userId, withPartners, withStacked }: { | ||||
| export function getTimeBucket({ albumId, isFavorite, isTrashed, key, order, personId, size, tagId, timeBucket, userId, visibility, withPartners, withStacked }: { | ||||
|     albumId?: string; | ||||
|     isArchived?: boolean; | ||||
|     isFavorite?: boolean; | ||||
|     isTrashed?: boolean; | ||||
|     key?: string; | ||||
| @@ -3254,6 +3246,7 @@ export function getTimeBucket({ albumId, isArchived, isFavorite, isTrashed, key, | ||||
|     tagId?: string; | ||||
|     timeBucket: string; | ||||
|     userId?: string; | ||||
|     visibility?: AssetVisibility; | ||||
|     withPartners?: boolean; | ||||
|     withStacked?: boolean; | ||||
| }, opts?: Oazapfts.RequestOpts) { | ||||
| @@ -3262,7 +3255,6 @@ export function getTimeBucket({ albumId, isArchived, isFavorite, isTrashed, key, | ||||
|         data: AssetResponseDto[]; | ||||
|     }>(`/timeline/bucket${QS.query(QS.explode({ | ||||
|         albumId, | ||||
|         isArchived, | ||||
|         isFavorite, | ||||
|         isTrashed, | ||||
|         key, | ||||
| @@ -3272,15 +3264,15 @@ export function getTimeBucket({ albumId, isArchived, isFavorite, isTrashed, key, | ||||
|         tagId, | ||||
|         timeBucket, | ||||
|         userId, | ||||
|         visibility, | ||||
|         withPartners, | ||||
|         withStacked | ||||
|     }))}`, { | ||||
|         ...opts | ||||
|     })); | ||||
| } | ||||
| export function getTimeBuckets({ albumId, isArchived, isFavorite, isTrashed, key, order, personId, size, tagId, userId, withPartners, withStacked }: { | ||||
| export function getTimeBuckets({ albumId, isFavorite, isTrashed, key, order, personId, size, tagId, userId, visibility, withPartners, withStacked }: { | ||||
|     albumId?: string; | ||||
|     isArchived?: boolean; | ||||
|     isFavorite?: boolean; | ||||
|     isTrashed?: boolean; | ||||
|     key?: string; | ||||
| @@ -3289,6 +3281,7 @@ export function getTimeBuckets({ albumId, isArchived, isFavorite, isTrashed, key | ||||
|     size: TimeBucketSize; | ||||
|     tagId?: string; | ||||
|     userId?: string; | ||||
|     visibility?: AssetVisibility; | ||||
|     withPartners?: boolean; | ||||
|     withStacked?: boolean; | ||||
| }, opts?: Oazapfts.RequestOpts) { | ||||
| @@ -3297,7 +3290,6 @@ export function getTimeBuckets({ albumId, isArchived, isFavorite, isTrashed, key | ||||
|         data: TimeBucketResponseDto[]; | ||||
|     }>(`/timeline/buckets${QS.query(QS.explode({ | ||||
|         albumId, | ||||
|         isArchived, | ||||
|         isFavorite, | ||||
|         isTrashed, | ||||
|         key, | ||||
| @@ -3306,6 +3298,7 @@ export function getTimeBuckets({ albumId, isArchived, isFavorite, isTrashed, key | ||||
|         size, | ||||
|         tagId, | ||||
|         userId, | ||||
|         visibility, | ||||
|         withPartners, | ||||
|         withStacked | ||||
|     }))}`, { | ||||
| @@ -3620,6 +3613,11 @@ export enum Permission { | ||||
|     AdminUserUpdate = "admin.user.update", | ||||
|     AdminUserDelete = "admin.user.delete" | ||||
| } | ||||
| export enum AssetVisibility { | ||||
|     Archive = "archive", | ||||
|     Timeline = "timeline", | ||||
|     Hidden = "hidden" | ||||
| } | ||||
| export enum AssetMediaStatus { | ||||
|     Created = "created", | ||||
|     Replaced = "replaced", | ||||
|   | ||||
		Reference in New Issue
	
	Block a user