refactor: remove tag entity (#17462)

This commit is contained in:
Jason Rasmussen
2025-04-08 10:52:54 -04:00
committed by GitHub
parent 75bc32b47b
commit b6c5a03533
12 changed files with 92 additions and 50 deletions
-19
View File
@@ -89,7 +89,6 @@ export const assetStub = {
isVisible: true,
livePhotoVideo: null,
livePhotoVideoId: null,
tags: [],
sharedLinks: [],
faces: [],
sidecarPath: null,
@@ -123,7 +122,6 @@ export const assetStub = {
isVisible: true,
livePhotoVideo: null,
livePhotoVideoId: null,
tags: [],
sharedLinks: [],
originalFileName: 'IMG_456.jpg',
faces: [],
@@ -162,7 +160,6 @@ export const assetStub = {
isExternal: false,
livePhotoVideo: null,
livePhotoVideoId: null,
tags: [],
sharedLinks: [],
originalFileName: 'asset-id.ext',
faces: [],
@@ -197,7 +194,6 @@ export const assetStub = {
isExternal: false,
livePhotoVideo: null,
livePhotoVideoId: null,
tags: [],
sharedLinks: [],
originalFileName: 'asset-id.jpg',
faces: [],
@@ -243,7 +239,6 @@ export const assetStub = {
isExternal: false,
livePhotoVideo: null,
livePhotoVideoId: null,
tags: [],
sharedLinks: [],
originalFileName: 'asset-id.jpg',
faces: [],
@@ -283,7 +278,6 @@ export const assetStub = {
isExternal: false,
livePhotoVideo: null,
livePhotoVideoId: null,
tags: [],
sharedLinks: [],
originalFileName: 'asset-id.jpg',
faces: [],
@@ -325,7 +319,6 @@ export const assetStub = {
isExternal: false,
livePhotoVideo: null,
livePhotoVideoId: null,
tags: [],
sharedLinks: [],
originalFileName: 'asset-id.jpg',
faces: [],
@@ -363,7 +356,6 @@ export const assetStub = {
isExternal: false,
livePhotoVideo: null,
livePhotoVideoId: null,
tags: [],
sharedLinks: [],
originalFileName: 'asset-id.jpg',
faces: [],
@@ -404,7 +396,6 @@ export const assetStub = {
livePhotoVideo: null,
livePhotoVideoId: null,
libraryId: 'library-id',
tags: [],
sharedLinks: [],
originalFileName: 'asset-id.jpg',
faces: [],
@@ -443,7 +434,6 @@ export const assetStub = {
livePhotoVideo: null,
livePhotoVideoId: null,
isExternal: false,
tags: [],
sharedLinks: [],
originalFileName: 'asset-id.ext',
faces: [],
@@ -480,7 +470,6 @@ export const assetStub = {
isVisible: true,
livePhotoVideo: null,
livePhotoVideoId: null,
tags: [],
sharedLinks: [],
originalFileName: 'asset-id.ext',
faces: [],
@@ -519,7 +508,6 @@ export const assetStub = {
isVisible: true,
livePhotoVideo: null,
livePhotoVideoId: null,
tags: [],
sharedLinks: [],
faces: [],
sidecarPath: null,
@@ -608,7 +596,6 @@ export const assetStub = {
isVisible: true,
livePhotoVideo: null,
livePhotoVideoId: null,
tags: [],
sharedLinks: [],
originalFileName: 'asset-id.ext',
faces: [],
@@ -650,7 +637,6 @@ export const assetStub = {
isVisible: true,
livePhotoVideo: null,
livePhotoVideoId: null,
tags: [],
sharedLinks: [],
originalFileName: 'asset-id.ext',
faces: [],
@@ -685,7 +671,6 @@ export const assetStub = {
isVisible: true,
livePhotoVideo: null,
livePhotoVideoId: null,
tags: [],
sharedLinks: [],
originalFileName: 'asset-id.ext',
faces: [],
@@ -721,7 +706,6 @@ export const assetStub = {
isVisible: true,
livePhotoVideo: null,
livePhotoVideoId: null,
tags: [],
sharedLinks: [],
faces: [],
sidecarPath: null,
@@ -759,7 +743,6 @@ export const assetStub = {
livePhotoVideo: null,
livePhotoVideoId: null,
libraryId: 'library-id',
tags: [],
sharedLinks: [],
originalFileName: 'photo.jpg',
faces: [],
@@ -797,7 +780,6 @@ export const assetStub = {
isExternal: false,
livePhotoVideo: null,
livePhotoVideoId: null,
tags: [],
sharedLinks: [],
originalFileName: 'asset-id.dng',
faces: [],
@@ -837,7 +819,6 @@ export const assetStub = {
isExternal: false,
livePhotoVideo: null,
livePhotoVideoId: null,
tags: [],
sharedLinks: [],
originalFileName: 'asset-id.hif',
faces: [],
-1
View File
@@ -241,7 +241,6 @@ export const sharedLinkStub = {
autoStackId: null,
rating: 3,
},
tags: [],
sharedLinks: [],
faces: [],
sidecarPath: null,
@@ -12,6 +12,7 @@ export const newAssetRepositoryMock = (): Mocked<RepositoryInterface<AssetReposi
getByDayOfYear: vitest.fn(),
getByIds: vitest.fn().mockResolvedValue([]),
getAssetForSearchDuplicatesJob: vitest.fn(),
getAssetForSidecarWriteJob: vitest.fn(),
getByIdsWithAllRelations: vitest.fn().mockResolvedValue([]),
getByAlbumId: vitest.fn(),
getByDeviceIds: vitest.fn(),
+22 -1
View File
@@ -1,5 +1,15 @@
import { randomUUID } from 'node:crypto';
import { ApiKey, Asset, AuthApiKey, AuthUser, Library, Partner, User, UserAdmin } from 'src/database';
import {
ApiKey,
Asset,
AuthApiKey,
AuthUser,
Library,
Partner,
SidecarWriteAsset,
User,
UserAdmin,
} from 'src/database';
import { AuthDto } from 'src/dtos/auth.dto';
import { AssetStatus, AssetType, MemoryType, Permission, UserStatus } from 'src/enum';
import { ActivityItem, MemoryItem, OnThisDayData } from 'src/types';
@@ -210,6 +220,14 @@ const versionHistoryFactory = () => ({
version: '1.123.45',
});
const assetSidecarWriteFactory = (asset: Partial<SidecarWriteAsset> = {}) => ({
id: newUuid(),
sidecarPath: '/path/to/original-path.jpg.xmp',
originalPath: '/path/to/original-path.jpg.xmp',
tags: [],
...asset,
});
export const factory = {
activity: activityFactory,
apiKey: apiKeyFactory,
@@ -225,4 +243,7 @@ export const factory = {
user: userFactory,
userAdmin: userAdminFactory,
versionHistory: versionHistoryFactory,
jobAssets: {
sidecarWrite: assetSidecarWriteFactory,
},
};