inlined function used to filter for the owned assets

This commit is contained in:
svsantos42 2026-05-01 11:12:10 -04:00
parent b8f56c1393
commit 7809277366
2 changed files with 3 additions and 7 deletions

View file

@ -11,7 +11,7 @@
toIsoDate,
type ZoneOption,
} from '$lib/modals/timezone-utils';
import { getOwnedAssetsObjects, getOwnedAssetsWithWarning } from '$lib/utils/asset-utils';
import { getOwnedAssetsWithWarning } from '$lib/utils/asset-utils';
import { getFullDateFormat } from '$lib/utils/date-time';
import { handleError } from '$lib/utils/handle-error';
import { updateAssets } from '@immich/sdk';
@ -68,8 +68,8 @@
},
});
let updatedAssets = getOwnedAssetsObjects(assets, authManager.user);
for (let asset of updatedAssets) {
const updatedAssets = assets.filter((a) => authManager.user && a.ownerId === authManager.user.id);
for (const asset of updatedAssets) {
asset.localOffsetHours = selectedOption.offsetMinutes / 60;
}

View file

@ -284,10 +284,6 @@ export const getOwnedAssetsWithWarning = (assets: TimelineAsset[], user: UserRes
return ids;
};
export const getOwnedAssetsObjects = (assets: TimelineAsset[], user: UserResponseDto | null): TimelineAsset[] => {
return [...assets].filter((a) => user && a.ownerId === user.id);
};
export type StackResponse = {
stack?: StackResponseDto;
toDeleteIds: string[];