feat(server): improve and refactor get all albums (#2048)

Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
Michel Heusschen 2023-03-26 04:46:48 +02:00 committed by GitHub
parent 2400004f41
commit c74fba483d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 1027 additions and 752 deletions

View file

@ -12,6 +12,7 @@ import {
Unique,
UpdateDateColumn,
} from 'typeorm';
import { AlbumEntity } from './album.entity';
import { ExifEntity } from './exif.entity';
import { SharedLinkEntity } from './shared-link.entity';
import { SmartInfoEntity } from './smart-info.entity';
@ -99,6 +100,9 @@ export class AssetEntity {
@ManyToMany(() => SharedLinkEntity, (link) => link.assets, { cascade: true })
@JoinTable({ name: 'shared_link__asset' })
sharedLinks!: SharedLinkEntity[];
@ManyToMany(() => AlbumEntity, (album) => album.assets)
albums?: AlbumEntity[];
}
export enum AssetType {