mirror of
https://github.com/immich-app/immich.git
synced 2026-03-06 10:07:48 +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:
@@ -6,7 +6,7 @@ import { InjectKysely } from 'nestjs-kysely';
|
||||
import { columns } from 'src/database';
|
||||
import { DB, UserMetadata as DbUserMetadata } from 'src/db';
|
||||
import { DummyValue, GenerateSql } from 'src/decorators';
|
||||
import { AssetType, UserStatus } from 'src/enum';
|
||||
import { AssetType, AssetVisibility, UserStatus } from 'src/enum';
|
||||
import { UserTable } from 'src/schema/tables/user.table';
|
||||
import { UserMetadata, UserMetadataItem } from 'src/types';
|
||||
import { asUuid } from 'src/utils/database';
|
||||
@@ -205,13 +205,19 @@ export class UserRepository {
|
||||
eb.fn
|
||||
.countAll<number>()
|
||||
.filterWhere((eb) =>
|
||||
eb.and([eb('assets.type', '=', sql.lit(AssetType.IMAGE)), eb('assets.isVisible', '=', sql.lit(true))]),
|
||||
eb.and([
|
||||
eb('assets.type', '=', sql.lit(AssetType.IMAGE)),
|
||||
eb('assets.visibility', '!=', sql.lit(AssetVisibility.HIDDEN)),
|
||||
]),
|
||||
)
|
||||
.as('photos'),
|
||||
eb.fn
|
||||
.countAll<number>()
|
||||
.filterWhere((eb) =>
|
||||
eb.and([eb('assets.type', '=', sql.lit(AssetType.VIDEO)), eb('assets.isVisible', '=', sql.lit(true))]),
|
||||
eb.and([
|
||||
eb('assets.type', '=', sql.lit(AssetType.VIDEO)),
|
||||
eb('assets.visibility', '!=', sql.lit(AssetVisibility.HIDDEN)),
|
||||
]),
|
||||
)
|
||||
.as('videos'),
|
||||
eb.fn
|
||||
|
||||
Reference in New Issue
Block a user