High performance self-hosted photo and video management solution.
TypeScript backup-toolfluttergoogle-photosgoogle-photos-alternativejavascriptmobile-appnestjsnodejsphoto-galleryphotosphotos-managementself-hostedsveltesveltekittypescriptvideos
chore: custom impl for set.difference api (#19135)
Alex144cc8ab6dcf
diff --git a/web/src/lib/managers/timeline-manager/group-insertion-cache.svelte.ts b/web/src/lib/managers/timeline-manager/group-insertion-cache.svelte.tsindex 0fdf18e302..66cca61d45 100644--- a/web/src/lib/managers/timeline-manager/group-insertion-cache.svelte.ts+++ b/web/src/lib/managers/timeline-manager/group-insertion-cache.svelte.ts@@ -1,4 +1,4 @@-import type { TimelinePlainDate } from '$lib/utils/timeline-util';+import { setDifference, type TimelinePlainDate } from '$lib/utils/timeline-util';import { AssetOrder } from '@immich/sdk';import type { DayGroup } from './day-group.svelte';import type { MonthGroup } from './month-group.svelte';@@ -27,7 +27,7 @@ export class GroupInsertionCache {}get existingDayGroups() {- return this.changedDayGroups.difference(this.newDayGroups);+ return setDifference(this.changedDayGroups, this.newDayGroups);}get updatedBuckets() {diff --git a/web/src/lib/managers/timeline-manager/internal/operations-support.svelte.ts b/web/src/lib/managers/timeline-manager/internal/operations-support.svelte.tsindex 9a45b821f1..82ec78499b 100644--- a/web/src/lib/managers/timeline-manager/internal/operations-support.svelte.ts+++ b/web/src/lib/managers/timeline-manager/internal/operations-support.svelte.ts@@ -1,4 +1,4 @@-import type { TimelinePlainDate } from '$lib/utils/timeline-util';+import { setDifference, type TimelinePlainDate } from '$lib/utils/timeline-util';import { AssetOrder } from '@immich/sdk';import { GroupInsertionCache } from '../group-insertion-cache.svelte';@@ -76,7 +76,7 @@ export function runAssetOperation(if (moveAssets.length > 0) {combinedMoveAssets.push(moveAssets);}- idsToProcess = idsToProcess.difference(processedIds);+ idsToProcess = setDifference(idsToProcess, processedIds);for (const id of processedIds) {idsProcessed.add(id);}diff --git a/web/src/lib/managers/timeline-manager/month-group.svelte.ts b/web/src/lib/managers/timeline-manager/month-group.svelte.tsindex 9a19429c49..f18a1e6413 100644--- a/web/src/lib/managers/timeline-manager/month-group.svelte.ts+++ b/web/src/lib/managers/timeline-manager/month-group.svelte.ts@@ -9,6 +9,7 @@ import {fromTimelinePlainDateTime,fromTimelinePlainYearMonth,getTimes,+ setDifference,type TimelinePlainDateTime,type TimelinePlainYearMonth,} from '$lib/utils/timeline-util';@@ -132,7 +133,7 @@ export class MonthGroup {if (moveAssets.length > 0) {combinedMoveAssets.push(moveAssets);}- idsToProcess = idsToProcess.difference(processedIds);+ idsToProcess = setDifference(idsToProcess, processedIds);for (const id of processedIds) {idsProcessed.add(id);}diff --git a/web/src/lib/utils/timeline-util.ts b/web/src/lib/utils/timeline-util.tsindex ce67355c12..c3e41c01be 100644--- a/web/src/lib/utils/timeline-util.ts+++ b/web/src/lib/utils/timeline-util.ts@@ -216,3 +216,13 @@ export const plainDateTimeCompare = (ascending: boolean, a: TimelinePlainDateTim}return aDateTime.millisecond - bDateTime.millisecond;};++export function setDifference<T>(setA: Set<T>, setB: Set<T>): Set<T> {+ const result = new Set<T>();+ for (const value of setA) {+ if (!setB.has(value)) {+ result.add(value);+ }+ }+ return result;+}