mirror of
https://github.com/immich-app/immich.git
synced 2026-03-01 18:19:10 +03: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:
@@ -3,7 +3,7 @@ import { Kysely, sql } from 'kysely';
|
||||
import { InjectKysely } from 'nestjs-kysely';
|
||||
import { DB } from 'src/db';
|
||||
import { ChunkedSet, DummyValue, GenerateSql } from 'src/decorators';
|
||||
import { AlbumUserRole } from 'src/enum';
|
||||
import { AlbumUserRole, AssetVisibility } from 'src/enum';
|
||||
import { asUuid } from 'src/utils/database';
|
||||
|
||||
class ActivityAccess {
|
||||
@@ -199,7 +199,13 @@ class AssetAccess {
|
||||
)
|
||||
.select('assets.id')
|
||||
.where('partner.sharedWithId', '=', userId)
|
||||
.where('assets.isArchived', '=', false)
|
||||
.where((eb) =>
|
||||
eb.or([
|
||||
eb('assets.visibility', '=', sql.lit(AssetVisibility.TIMELINE)),
|
||||
eb('assets.visibility', '=', sql.lit(AssetVisibility.HIDDEN)),
|
||||
]),
|
||||
)
|
||||
|
||||
.where('assets.id', 'in', [...assetIds])
|
||||
.execute()
|
||||
.then((assets) => new Set(assets.map((asset) => asset.id)));
|
||||
|
||||
Reference in New Issue
Block a user