mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
refactor: always use the same bucket size (#4662)
This commit is contained in:
parent
0167407370
commit
c76c1d6bf8
9 changed files with 17 additions and 21 deletions
|
|
@ -5,7 +5,7 @@
|
|||
import { dragAndDropFilesStore } from '$lib/stores/drag-and-drop-files.store';
|
||||
import { locale } from '$lib/stores/preferences.store';
|
||||
import { fileUploadHandler, openFileUploadDialog } from '$lib/utils/file-uploader';
|
||||
import { TimeBucketSize, type AlbumResponseDto, type SharedLinkResponseDto } from '@api';
|
||||
import type { AlbumResponseDto, SharedLinkResponseDto } from '@api';
|
||||
import { onDestroy, onMount } from 'svelte';
|
||||
import { dateFormats } from '../../constants';
|
||||
import { createAssetInteractionStore } from '../../stores/asset-interaction.store';
|
||||
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
let { isViewing: showAssetViewer } = assetViewingStore;
|
||||
|
||||
const assetStore = new AssetStore({ size: TimeBucketSize.Month, albumId: album.id });
|
||||
const assetStore = new AssetStore({ albumId: album.id });
|
||||
const assetInteractionStore = createAssetInteractionStore();
|
||||
const { isMultiSelectState, selectedAssets } = assetInteractionStore;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { api, AssetApiGetTimeBucketsRequest, AssetResponseDto } from '@api';
|
||||
import { api, AssetApiGetTimeBucketsRequest, AssetResponseDto, TimeBucketSize } from '@api';
|
||||
import { throttle } from 'lodash-es';
|
||||
import { DateTime } from 'luxon';
|
||||
import { Unsubscriber, writable } from 'svelte/store';
|
||||
|
|
@ -12,7 +12,7 @@ export enum BucketPosition {
|
|||
Unknown = 'unknown',
|
||||
}
|
||||
|
||||
export type AssetStoreOptions = AssetApiGetTimeBucketsRequest;
|
||||
export type AssetStoreOptions = Omit<AssetApiGetTimeBucketsRequest, 'size'>;
|
||||
|
||||
export interface Viewport {
|
||||
width: number;
|
||||
|
|
@ -64,6 +64,7 @@ export class AssetStore {
|
|||
private assetToBucket: Record<string, AssetLookup> = {};
|
||||
private pendingChanges: PendingChange[] = [];
|
||||
private unsubscribers: Unsubscriber[] = [];
|
||||
private options: AssetApiGetTimeBucketsRequest;
|
||||
|
||||
initialized = false;
|
||||
timelineHeight = 0;
|
||||
|
|
@ -71,7 +72,8 @@ export class AssetStore {
|
|||
assets: AssetResponseDto[] = [];
|
||||
albumAssets: Set<string> = new Set();
|
||||
|
||||
constructor(private options: AssetStoreOptions, private albumId?: string) {
|
||||
constructor(options: AssetStoreOptions, private albumId?: string) {
|
||||
this.options = { ...options, size: TimeBucketSize.Month };
|
||||
this.store$.set(this);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue