mirror of
https://github.com/immich-app/immich.git
synced 2025-07-03 21:40:00 +02:00
fix(server): don't delete offline files from disk when trash empties (#14777)
fix: don't delete offline files from disk when emptying trash Move logic to asset deletion check
This commit is contained in:
parent
10e569cc1c
commit
23f3e737fd
6 changed files with 289 additions and 23 deletions
e2e/src
|
@ -10,6 +10,7 @@ import {
|
|||
Permission,
|
||||
PersonCreateDto,
|
||||
SharedLinkCreateDto,
|
||||
UpdateLibraryDto,
|
||||
UserAdminCreateDto,
|
||||
UserPreferencesUpdateDto,
|
||||
ValidateLibraryDto,
|
||||
|
@ -35,6 +36,7 @@ import {
|
|||
updateAlbumUser,
|
||||
updateAssets,
|
||||
updateConfig,
|
||||
updateLibrary,
|
||||
updateMyPreferences,
|
||||
upsertTags,
|
||||
validate,
|
||||
|
@ -42,7 +44,7 @@ import {
|
|||
import { BrowserContext } from '@playwright/test';
|
||||
import { exec, spawn } from 'node:child_process';
|
||||
import { createHash } from 'node:crypto';
|
||||
import { existsSync, mkdirSync, rmSync, writeFileSync } from 'node:fs';
|
||||
import { existsSync, mkdirSync, renameSync, rmSync, writeFileSync } from 'node:fs';
|
||||
import { tmpdir } from 'node:os';
|
||||
import path, { dirname } from 'node:path';
|
||||
import { setTimeout as setAsyncTimeout } from 'node:timers/promises';
|
||||
|
@ -392,6 +394,14 @@ export const utils = {
|
|||
rmSync(path);
|
||||
},
|
||||
|
||||
renameImageFile: (oldPath: string, newPath: string) => {
|
||||
if (!existsSync(oldPath)) {
|
||||
return;
|
||||
}
|
||||
|
||||
renameSync(oldPath, newPath);
|
||||
},
|
||||
|
||||
removeDirectory: (path: string) => {
|
||||
if (!existsSync(path)) {
|
||||
return;
|
||||
|
@ -447,6 +457,9 @@ 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) =>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue