1
0
mirror of https://github.com/immich-app/immich.git synced 2025-02-12 19:16:53 +02:00
This commit is contained in:
Jonathan Jogenfors 2025-01-08 01:03:22 +01:00
parent c50aa1ba06
commit 32ce597508
5 changed files with 209 additions and 53 deletions

View File

@ -460,9 +460,6 @@ export const utils = {
validateLibrary: (accessToken: string, id: string, dto: ValidateLibraryDto) =>
validate({ id, validateLibraryDto: dto }, { headers: asBearerAuth(accessToken) }),
updateLibrary: (accessToken: string, id: string, dto: UpdateLibraryDto) =>
updateLibrary({ id, updateLibraryDto: dto }, { headers: asBearerAuth(accessToken) }),
createPartner: (accessToken: string, id: string) => createPartner({ id }, { headers: asBearerAuth(accessToken) }),
updateMyPreferences: (accessToken: string, userPreferencesUpdateDto: UserPreferencesUpdateDto) =>

View File

@ -7573,7 +7573,11 @@
"type": "string"
},
"type": {
"$ref": "#/components/schemas/ReactionType"
"allOf": [
{
"$ref": "#/components/schemas/ReactionType"
}
]
}
},
"required": [
@ -7600,7 +7604,11 @@
"type": "string"
},
"type": {
"$ref": "#/components/schemas/ReactionType"
"allOf": [
{
"$ref": "#/components/schemas/ReactionType"
}
]
},
"user": {
"$ref": "#/components/schemas/UserResponseDto"
@ -7701,7 +7709,11 @@
"type": "string"
},
"order": {
"$ref": "#/components/schemas/AssetOrder"
"allOf": [
{
"$ref": "#/components/schemas/AssetOrder"
}
]
},
"owner": {
"$ref": "#/components/schemas/UserResponseDto"
@ -7761,7 +7773,12 @@
"AlbumUserAddDto": {
"properties": {
"role": {
"$ref": "#/components/schemas/AlbumUserRole"
"allOf": [
{
"$ref": "#/components/schemas/AlbumUserRole"
}
],
"default": "editor"
},
"userId": {
"format": "uuid",
@ -7776,7 +7793,11 @@
"AlbumUserCreateDto": {
"properties": {
"role": {
"$ref": "#/components/schemas/AlbumUserRole"
"allOf": [
{
"$ref": "#/components/schemas/AlbumUserRole"
}
]
},
"userId": {
"format": "uuid",
@ -7792,7 +7813,11 @@
"AlbumUserResponseDto": {
"properties": {
"role": {
"$ref": "#/components/schemas/AlbumUserRole"
"allOf": [
{
"$ref": "#/components/schemas/AlbumUserRole"
}
]
},
"user": {
"$ref": "#/components/schemas/UserResponseDto"
@ -8089,7 +8114,11 @@
"nullable": true
},
"sourceType": {
"$ref": "#/components/schemas/SourceType"
"allOf": [
{
"$ref": "#/components/schemas/SourceType"
}
]
}
},
"required": [
@ -8160,7 +8189,11 @@
"type": "integer"
},
"sourceType": {
"$ref": "#/components/schemas/SourceType"
"allOf": [
{
"$ref": "#/components/schemas/SourceType"
}
]
}
},
"required": [
@ -8256,7 +8289,11 @@
"type": "array"
},
"name": {
"$ref": "#/components/schemas/AssetJobName"
"allOf": [
{
"$ref": "#/components/schemas/AssetJobName"
}
]
}
},
"required": [
@ -8354,7 +8391,11 @@
"type": "string"
},
"status": {
"$ref": "#/components/schemas/AssetMediaStatus"
"allOf": [
{
"$ref": "#/components/schemas/AssetMediaStatus"
}
]
}
},
"required": [
@ -8492,7 +8533,11 @@
"type": "string"
},
"type": {
"$ref": "#/components/schemas/AssetTypeEnum"
"allOf": [
{
"$ref": "#/components/schemas/AssetTypeEnum"
}
]
},
"unassignedFaces": {
"items": {
@ -8605,7 +8650,11 @@
"AvatarResponse": {
"properties": {
"color": {
"$ref": "#/components/schemas/UserAvatarColor"
"allOf": [
{
"$ref": "#/components/schemas/UserAvatarColor"
}
]
}
},
"required": [
@ -8616,7 +8665,11 @@
"AvatarUpdate": {
"properties": {
"color": {
"$ref": "#/components/schemas/UserAvatarColor"
"allOf": [
{
"$ref": "#/components/schemas/UserAvatarColor"
}
]
}
},
"type": "object"
@ -9253,10 +9306,18 @@
"type": "string"
},
"entityType": {
"$ref": "#/components/schemas/PathEntityType"
"allOf": [
{
"$ref": "#/components/schemas/PathEntityType"
}
]
},
"pathType": {
"$ref": "#/components/schemas/PathType"
"allOf": [
{
"$ref": "#/components/schemas/PathType"
}
]
},
"pathValue": {
"type": "string"
@ -9318,7 +9379,11 @@
"JobCommandDto": {
"properties": {
"command": {
"$ref": "#/components/schemas/JobCommand"
"allOf": [
{
"$ref": "#/components/schemas/JobCommand"
}
]
},
"force": {
"type": "boolean"
@ -9363,7 +9428,11 @@
"JobCreateDto": {
"properties": {
"name": {
"$ref": "#/components/schemas/ManualJobName"
"allOf": [
{
"$ref": "#/components/schemas/ManualJobName"
}
]
}
},
"required": [
@ -9697,7 +9766,11 @@
"type": "string"
},
"type": {
"$ref": "#/components/schemas/MemoryType"
"allOf": [
{
"$ref": "#/components/schemas/MemoryType"
}
]
}
},
"required": [
@ -9762,7 +9835,11 @@
"type": "string"
},
"type": {
"$ref": "#/components/schemas/MemoryType"
"allOf": [
{
"$ref": "#/components/schemas/MemoryType"
}
]
},
"updatedAt": {
"format": "date-time",
@ -9891,7 +9968,11 @@
"type": "string"
},
"order": {
"$ref": "#/components/schemas/AssetOrder"
"allOf": [
{
"$ref": "#/components/schemas/AssetOrder"
}
]
},
"originalFileName": {
"type": "string"
@ -9942,7 +10023,11 @@
"type": "string"
},
"type": {
"$ref": "#/components/schemas/AssetTypeEnum"
"allOf": [
{
"$ref": "#/components/schemas/AssetTypeEnum"
}
]
},
"updatedAfter": {
"format": "date-time",
@ -10026,7 +10111,11 @@
"PartnerResponseDto": {
"properties": {
"avatarColor": {
"$ref": "#/components/schemas/UserAvatarColor"
"allOf": [
{
"$ref": "#/components/schemas/UserAvatarColor"
}
]
},
"email": {
"type": "string"
@ -10544,7 +10633,11 @@
"type": "string"
},
"type": {
"$ref": "#/components/schemas/AssetTypeEnum"
"allOf": [
{
"$ref": "#/components/schemas/AssetTypeEnum"
}
]
},
"updatedAfter": {
"format": "date-time",
@ -11212,7 +11305,11 @@
"type": "boolean"
},
"type": {
"$ref": "#/components/schemas/SharedLinkType"
"allOf": [
{
"$ref": "#/components/schemas/SharedLinkType"
}
]
}
},
"required": [
@ -11297,7 +11394,11 @@
"type": "string"
},
"type": {
"$ref": "#/components/schemas/SharedLinkType"
"allOf": [
{
"$ref": "#/components/schemas/SharedLinkType"
}
]
},
"userId": {
"type": "string"
@ -11447,7 +11548,11 @@
"type": "string"
},
"type": {
"$ref": "#/components/schemas/AssetTypeEnum"
"allOf": [
{
"$ref": "#/components/schemas/AssetTypeEnum"
}
]
},
"updatedAfter": {
"format": "date-time",
@ -11629,7 +11734,11 @@
"SystemConfigFFmpegDto": {
"properties": {
"accel": {
"$ref": "#/components/schemas/TranscodeHWAccel"
"allOf": [
{
"$ref": "#/components/schemas/TranscodeHWAccel"
}
]
},
"accelDecode": {
"type": "boolean"
@ -11658,7 +11767,11 @@
"type": "integer"
},
"cqMode": {
"$ref": "#/components/schemas/CQMode"
"allOf": [
{
"$ref": "#/components/schemas/CQMode"
}
]
},
"crf": {
"maximum": 51,
@ -11684,13 +11797,21 @@
"type": "integer"
},
"targetAudioCodec": {
"$ref": "#/components/schemas/AudioCodec"
"allOf": [
{
"$ref": "#/components/schemas/AudioCodec"
}
]
},
"targetResolution": {
"type": "string"
},
"targetVideoCodec": {
"$ref": "#/components/schemas/VideoCodec"
"allOf": [
{
"$ref": "#/components/schemas/VideoCodec"
}
]
},
"temporalAQ": {
"type": "boolean"
@ -11700,10 +11821,18 @@
"type": "integer"
},
"tonemap": {
"$ref": "#/components/schemas/ToneMapping"
"allOf": [
{
"$ref": "#/components/schemas/ToneMapping"
}
]
},
"transcode": {
"$ref": "#/components/schemas/TranscodePolicy"
"allOf": [
{
"$ref": "#/components/schemas/TranscodePolicy"
}
]
},
"twoPass": {
"type": "boolean"
@ -11748,7 +11877,11 @@
"SystemConfigGeneratedImageDto": {
"properties": {
"format": {
"$ref": "#/components/schemas/ImageFormat"
"allOf": [
{
"$ref": "#/components/schemas/ImageFormat"
}
]
},
"quality": {
"maximum": 100,
@ -11770,7 +11903,11 @@
"SystemConfigImageDto": {
"properties": {
"colorspace": {
"$ref": "#/components/schemas/Colorspace"
"allOf": [
{
"$ref": "#/components/schemas/Colorspace"
}
]
},
"extractEmbedded": {
"type": "boolean"
@ -11888,7 +12025,11 @@
"type": "boolean"
},
"level": {
"$ref": "#/components/schemas/LogLevel"
"allOf": [
{
"$ref": "#/components/schemas/LogLevel"
}
]
}
},
"required": [
@ -12559,7 +12700,11 @@
"type": "boolean"
},
"order": {
"$ref": "#/components/schemas/AssetOrder"
"allOf": [
{
"$ref": "#/components/schemas/AssetOrder"
}
]
}
},
"type": "object"
@ -12567,7 +12712,11 @@
"UpdateAlbumUserDto": {
"properties": {
"role": {
"$ref": "#/components/schemas/AlbumUserRole"
"allOf": [
{
"$ref": "#/components/schemas/AlbumUserRole"
}
]
}
},
"required": [
@ -12734,7 +12883,11 @@
"UserAdminResponseDto": {
"properties": {
"avatarColor": {
"$ref": "#/components/schemas/UserAvatarColor"
"allOf": [
{
"$ref": "#/components/schemas/UserAvatarColor"
}
]
},
"createdAt": {
"format": "date-time",
@ -12789,7 +12942,11 @@
"type": "boolean"
},
"status": {
"$ref": "#/components/schemas/UserStatus"
"allOf": [
{
"$ref": "#/components/schemas/UserStatus"
}
]
},
"storageLabel": {
"nullable": true,
@ -12962,7 +13119,11 @@
"UserResponseDto": {
"properties": {
"avatarColor": {
"$ref": "#/components/schemas/UserAvatarColor"
"allOf": [
{
"$ref": "#/components/schemas/UserAvatarColor"
}
]
},
"email": {
"type": "string"

View File

@ -3,7 +3,6 @@ import { ApiTags } from '@nestjs/swagger';
import {
CreateLibraryDto,
LibraryResponseDto,
LibraryStatsResponseDto,
UpdateLibraryDto,
ValidateLibraryDto,
ValidateLibraryResponseDto,

View File

@ -1,4 +1,3 @@
import { ADDED_IN_PREFIX } from 'src/constants';
import { LibraryStatsResponseDto } from 'src/dtos/library.dto';
import { LibraryEntity } from 'src/entities/library.entity';

View File

@ -7,7 +7,6 @@ import { OnEvent, OnJob } from 'src/decorators';
import {
CreateLibraryDto,
LibraryResponseDto,
LibraryStatsResponseDto,
mapLibrary,
UpdateLibraryDto,
ValidateLibraryDto,
@ -15,7 +14,6 @@ import {
ValidateLibraryResponseDto,
} from 'src/dtos/library.dto';
import { AssetEntity } from 'src/entities/asset.entity';
import { LibraryEntity } from 'src/entities/library.entity';
import { AssetStatus, AssetType, ImmichWorker } from 'src/enum';
import { AssetCreate } from 'src/interfaces/asset.interface';
import { DatabaseLock } from 'src/interfaces/database.interface';
@ -358,8 +356,8 @@ export class LibraryService extends BaseService {
const datePlaceholder = new Date('1900-01-01');
return {
ownerId: ownerId,
libraryId: libraryId,
ownerId,
libraryId,
checksum: this.cryptoRepository.hashSha1(`path:${assetPath}`),
originalPath: assetPath,
@ -442,16 +440,18 @@ export class LibraryService extends BaseService {
for (const asset of assets) {
const action = await this.handleSyncAsset(asset);
switch (action) {
case AssetSyncResult.OFFLINE:
case AssetSyncResult.OFFLINE: {
assetIdsToOffline.push(asset.id);
break;
case AssetSyncResult.UPDATE:
}
case AssetSyncResult.UPDATE: {
assetIdsToUpdate.push(asset.id);
break;
}
}
}
if (assetIdsToOffline.length) {
if (assetIdsToOffline.length > 0) {
await this.assetRepository.updateAll(assetIdsToOffline, {
isOffline: true,
status: AssetStatus.TRASHED,
@ -459,7 +459,7 @@ export class LibraryService extends BaseService {
});
}
if (assetIdsToUpdate.length) {
if (assetIdsToUpdate.length > 0) {
//TODO: When we have asset status, we need to leave deletedAt as is when status is trashed
await this.assetRepository.updateAll(assetIdsToUpdate, {
isOffline: false,