mirror of
https://github.com/immich-app/immich.git
synced 2025-07-09 03:04:16 -04:00
prefix duplicate key on upload asset to not existing bucket
This commit is contained in:
parent
287a3bbfa4
commit
1037f7f4e7
@ -403,8 +403,12 @@ export class AssetBucket {
|
|||||||
}
|
}
|
||||||
if (dateGroup) {
|
if (dateGroup) {
|
||||||
const intersectingAsset = new IntersectingAsset(dateGroup, asset);
|
const intersectingAsset = new IntersectingAsset(dateGroup, asset);
|
||||||
dateGroup.intersetingAssets.push(intersectingAsset);
|
if (dateGroup.intersetingAssets.some((a) => a.id === asset.id)) {
|
||||||
changedDateGroups.add(dateGroup);
|
console.error(`Ignoring attempt to add duplicate asset ${asset.id} to ${dateGroup.groupTitle}`);
|
||||||
|
} else {
|
||||||
|
dateGroup.intersetingAssets.push(intersectingAsset);
|
||||||
|
changedDateGroups.add(dateGroup);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
dateGroup = new AssetDateGroup(this, this.dateGroups.length, date, day);
|
dateGroup = new AssetDateGroup(this, this.dateGroups.length, date, day);
|
||||||
dateGroup.intersetingAssets.push(new IntersectingAsset(dateGroup, asset));
|
dateGroup.intersetingAssets.push(new IntersectingAsset(dateGroup, asset));
|
||||||
@ -1001,6 +1005,11 @@ export class AssetStore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const result = await bucket.loader?.execute(async (signal: AbortSignal) => {
|
const result = await bucket.loader?.execute(async (signal: AbortSignal) => {
|
||||||
|
if (!!bucket.getFirstAsset()) {
|
||||||
|
// this happens when a bucket was created by an event instead of via a loadBucket call
|
||||||
|
// so no need to load the bucket, it already has assets
|
||||||
|
return;
|
||||||
|
}
|
||||||
const assets = await getTimeBucket(
|
const assets = await getTimeBucket(
|
||||||
{
|
{
|
||||||
...this.#options,
|
...this.#options,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user