mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
refactor(server): change asset entity to date type (#2599)
* refactor(server): change asset entity to date type * lower coverage threshold
This commit is contained in:
@@ -140,8 +140,8 @@ export const assetEntityStub = {
|
||||
id: 'asset-id',
|
||||
originalFileName: 'asset_1.jpeg',
|
||||
deviceAssetId: 'device-asset-id',
|
||||
fileModifiedAt: '2023-02-23T05:06:29.716Z',
|
||||
fileCreatedAt: '2023-02-23T05:06:29.716Z',
|
||||
fileModifiedAt: new Date('2023-02-23T05:06:29.716Z'),
|
||||
fileCreatedAt: new Date('2023-02-23T05:06:29.716Z'),
|
||||
owner: userEntityStub.user1,
|
||||
ownerId: 'user-id',
|
||||
deviceId: 'device-id',
|
||||
@@ -151,8 +151,8 @@ export const assetEntityStub = {
|
||||
type: AssetType.IMAGE,
|
||||
webpPath: null,
|
||||
encodedVideoPath: null,
|
||||
createdAt: '2023-02-23T05:06:29.716Z',
|
||||
updatedAt: '2023-02-23T05:06:29.716Z',
|
||||
createdAt: new Date('2023-02-23T05:06:29.716Z'),
|
||||
updatedAt: new Date('2023-02-23T05:06:29.716Z'),
|
||||
mimeType: null,
|
||||
isFavorite: true,
|
||||
isArchived: false,
|
||||
@@ -168,8 +168,8 @@ export const assetEntityStub = {
|
||||
image: Object.freeze<AssetEntity>({
|
||||
id: 'asset-id',
|
||||
deviceAssetId: 'device-asset-id',
|
||||
fileModifiedAt: '2023-02-23T05:06:29.716Z',
|
||||
fileCreatedAt: '2023-02-23T05:06:29.716Z',
|
||||
fileModifiedAt: new Date('2023-02-23T05:06:29.716Z'),
|
||||
fileCreatedAt: new Date('2023-02-23T05:06:29.716Z'),
|
||||
owner: userEntityStub.user1,
|
||||
ownerId: 'user-id',
|
||||
deviceId: 'device-id',
|
||||
@@ -179,8 +179,8 @@ export const assetEntityStub = {
|
||||
type: AssetType.IMAGE,
|
||||
webpPath: null,
|
||||
encodedVideoPath: null,
|
||||
createdAt: '2023-02-23T05:06:29.716Z',
|
||||
updatedAt: '2023-02-23T05:06:29.716Z',
|
||||
createdAt: new Date('2023-02-23T05:06:29.716Z'),
|
||||
updatedAt: new Date('2023-02-23T05:06:29.716Z'),
|
||||
mimeType: null,
|
||||
isFavorite: true,
|
||||
isArchived: false,
|
||||
@@ -198,8 +198,8 @@ export const assetEntityStub = {
|
||||
id: 'asset-id',
|
||||
originalFileName: 'asset-id.ext',
|
||||
deviceAssetId: 'device-asset-id',
|
||||
fileModifiedAt: '2023-02-23T05:06:29.716Z',
|
||||
fileCreatedAt: '2023-02-23T05:06:29.716Z',
|
||||
fileModifiedAt: new Date('2023-02-23T05:06:29.716Z'),
|
||||
fileCreatedAt: new Date('2023-02-23T05:06:29.716Z'),
|
||||
owner: userEntityStub.user1,
|
||||
ownerId: 'user-id',
|
||||
deviceId: 'device-id',
|
||||
@@ -209,8 +209,8 @@ export const assetEntityStub = {
|
||||
type: AssetType.VIDEO,
|
||||
webpPath: null,
|
||||
encodedVideoPath: null,
|
||||
createdAt: '2023-02-23T05:06:29.716Z',
|
||||
updatedAt: '2023-02-23T05:06:29.716Z',
|
||||
createdAt: new Date('2023-02-23T05:06:29.716Z'),
|
||||
updatedAt: new Date('2023-02-23T05:06:29.716Z'),
|
||||
mimeType: null,
|
||||
isFavorite: true,
|
||||
isArchived: false,
|
||||
@@ -229,8 +229,8 @@ export const assetEntityStub = {
|
||||
ownerId: authStub.user1.id,
|
||||
type: AssetType.VIDEO,
|
||||
isVisible: false,
|
||||
fileModifiedAt: '2022-06-19T23:41:36.910Z',
|
||||
fileCreatedAt: '2022-06-19T23:41:36.910Z',
|
||||
fileModifiedAt: new Date('2022-06-19T23:41:36.910Z'),
|
||||
fileCreatedAt: new Date('2022-06-19T23:41:36.910Z'),
|
||||
} as AssetEntity),
|
||||
|
||||
livePhotoStillAsset: Object.freeze({
|
||||
@@ -240,15 +240,15 @@ export const assetEntityStub = {
|
||||
type: AssetType.IMAGE,
|
||||
livePhotoVideoId: 'live-photo-motion-asset',
|
||||
isVisible: true,
|
||||
fileModifiedAt: '2022-06-19T23:41:36.910Z',
|
||||
fileCreatedAt: '2022-06-19T23:41:36.910Z',
|
||||
fileModifiedAt: new Date('2022-06-19T23:41:36.910Z'),
|
||||
fileCreatedAt: new Date('2022-06-19T23:41:36.910Z'),
|
||||
} as AssetEntity),
|
||||
|
||||
withLocation: Object.freeze<AssetEntity>({
|
||||
id: 'asset-with-favorite-id',
|
||||
deviceAssetId: 'device-asset-id',
|
||||
fileModifiedAt: '2023-02-23T05:06:29.716Z',
|
||||
fileCreatedAt: '2023-02-23T05:06:29.716Z',
|
||||
fileModifiedAt: new Date('2023-02-23T05:06:29.716Z'),
|
||||
fileCreatedAt: new Date('2023-02-23T05:06:29.716Z'),
|
||||
owner: userEntityStub.user1,
|
||||
ownerId: 'user-id',
|
||||
deviceId: 'device-id',
|
||||
@@ -259,8 +259,8 @@ export const assetEntityStub = {
|
||||
type: AssetType.IMAGE,
|
||||
webpPath: null,
|
||||
encodedVideoPath: null,
|
||||
createdAt: '2023-02-23T05:06:29.716Z',
|
||||
updatedAt: '2023-02-23T05:06:29.716Z',
|
||||
createdAt: new Date('2023-02-23T05:06:29.716Z'),
|
||||
updatedAt: new Date('2023-02-23T05:06:29.716Z'),
|
||||
mimeType: null,
|
||||
isFavorite: false,
|
||||
isArchived: false,
|
||||
@@ -280,8 +280,8 @@ export const assetEntityStub = {
|
||||
sidecar: Object.freeze<AssetEntity>({
|
||||
id: 'asset-id',
|
||||
deviceAssetId: 'device-asset-id',
|
||||
fileModifiedAt: '2023-02-23T05:06:29.716Z',
|
||||
fileCreatedAt: '2023-02-23T05:06:29.716Z',
|
||||
fileModifiedAt: new Date('2023-02-23T05:06:29.716Z'),
|
||||
fileCreatedAt: new Date('2023-02-23T05:06:29.716Z'),
|
||||
owner: userEntityStub.user1,
|
||||
ownerId: 'user-id',
|
||||
deviceId: 'device-id',
|
||||
@@ -291,8 +291,8 @@ export const assetEntityStub = {
|
||||
type: AssetType.IMAGE,
|
||||
webpPath: null,
|
||||
encodedVideoPath: null,
|
||||
createdAt: '2023-02-23T05:06:29.716Z',
|
||||
updatedAt: '2023-02-23T05:06:29.716Z',
|
||||
createdAt: new Date('2023-02-23T05:06:29.716Z'),
|
||||
updatedAt: new Date('2023-02-23T05:06:29.716Z'),
|
||||
mimeType: null,
|
||||
isFavorite: true,
|
||||
isArchived: false,
|
||||
@@ -447,9 +447,9 @@ const assetResponse: AssetResponseDto = {
|
||||
originalPath: 'fake_path/jpeg',
|
||||
originalFileName: 'asset_1.jpeg',
|
||||
resized: false,
|
||||
fileModifiedAt: today.toISOString(),
|
||||
fileCreatedAt: today.toISOString(),
|
||||
updatedAt: today.toISOString(),
|
||||
fileModifiedAt: today,
|
||||
fileCreatedAt: today,
|
||||
updatedAt: today,
|
||||
isFavorite: false,
|
||||
isArchived: false,
|
||||
mimeType: 'image/jpeg',
|
||||
@@ -700,10 +700,10 @@ export const sharedLinkStub = {
|
||||
originalPath: 'fake_path/jpeg',
|
||||
resizePath: '',
|
||||
checksum: Buffer.from('file hash', 'utf8'),
|
||||
fileModifiedAt: today.toISOString(),
|
||||
fileCreatedAt: today.toISOString(),
|
||||
createdAt: today.toISOString(),
|
||||
updatedAt: today.toISOString(),
|
||||
fileModifiedAt: today,
|
||||
fileCreatedAt: today,
|
||||
createdAt: today,
|
||||
updatedAt: today,
|
||||
isFavorite: false,
|
||||
isArchived: false,
|
||||
mimeType: 'image/jpeg',
|
||||
|
||||
Reference in New Issue
Block a user