mirror of
https://github.com/immich-app/immich.git
synced 2026-03-06 18:17:27 +03:00
fix(server): deleting stacked assets (#25874)
* fix(server): deleting stacked assets * fix: log a warning when removing an empty directory fails
This commit is contained in:
@@ -327,10 +327,11 @@ export class AssetService extends BaseService {
|
||||
return JobStatus.Failed;
|
||||
}
|
||||
|
||||
// Replace the parent of the stack children with a new asset
|
||||
// replace the parent of the stack children with a new asset
|
||||
if (asset.stack?.primaryAssetId === id) {
|
||||
const stackAssetIds = asset.stack?.assets.map((a) => a.id) ?? [];
|
||||
if (stackAssetIds.length > 2) {
|
||||
// this only includes timeline visible assets and excludes the primary asset
|
||||
const stackAssetIds = asset.stack.assets.map((a) => a.id);
|
||||
if (stackAssetIds.length >= 2) {
|
||||
const newPrimaryAssetId = stackAssetIds.find((a) => a !== id)!;
|
||||
await this.stackRepository.update(asset.stack.id, {
|
||||
id: asset.stack.id,
|
||||
|
||||
Reference in New Issue
Block a user