mirror of
https://github.com/immich-app/immich.git
synced 2025-12-06 07:25:30 -08:00
Compare commits
1 Commits
v1.135.2
...
fix/web-no
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e62071fda0 |
@@ -32,7 +32,7 @@ export async function getAssetWithOffset(
|
||||
|
||||
export function findMonthGroupForAsset(timelineManager: TimelineManager, id: string) {
|
||||
for (const month of timelineManager.months) {
|
||||
const asset = month.findAssetById({ id });
|
||||
const asset = month.findAssetById(id);
|
||||
if (asset) {
|
||||
return { monthGroup: month, asset };
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ import { get } from 'svelte/store';
|
||||
import { DayGroup } from './day-group.svelte';
|
||||
import { GroupInsertionCache } from './group-insertion-cache.svelte';
|
||||
import type { TimelineManager } from './timeline-manager.svelte';
|
||||
import type { AssetDescriptor, AssetOperation, Direction, MoveAsset, TimelineAsset } from './types';
|
||||
import type { AssetOperation, Direction, MoveAsset, TimelineAsset } from './types';
|
||||
import { ViewerAsset } from './viewer-asset.svelte';
|
||||
|
||||
export class MonthGroup {
|
||||
@@ -342,8 +342,12 @@ export class MonthGroup {
|
||||
}
|
||||
}
|
||||
|
||||
findAssetById(assetDescriptor: AssetDescriptor) {
|
||||
return this.assetsIterator().find((asset) => asset.id === assetDescriptor.id);
|
||||
findAssetById(id: string) {
|
||||
for (const asset of this.assetsIterator()) {
|
||||
if (asset.id === id) {
|
||||
return asset;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
findClosest(target: TimelinePlainDateTime) {
|
||||
|
||||
@@ -428,7 +428,7 @@ export class TimelineManager {
|
||||
return;
|
||||
}
|
||||
monthGroup = await this.#loadMonthGroupAtTime(asset.localDateTime, { cancelable: false });
|
||||
if (monthGroup?.findAssetById({ id })) {
|
||||
if (monthGroup?.findAssetById(id)) {
|
||||
return monthGroup;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user