refactor(cover): move cover-coupled hooks into cover/; drop deprecated usePlaybackCoverArt shim

This commit is contained in:
Psychotoxical
2026-06-30 19:52:29 +02:00
parent 28e049425e
commit f03a5f13e8
15 changed files with 19 additions and 21 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ import { useQueueResizer } from '@/features/queue';
import { useGlobalDndAndSelectionBlockers } from '@/lib/hooks/useGlobalDndAndSelectionBlockers';
import { useAppActivityTracking } from '../hooks/useAppActivityTracking';
import { useMainScrollingIndicator } from '../hooks/useMainScrollingIndicator';
import { useCoverNavigationPriority } from '../hooks/useCoverNavigationPriority';
import { useCoverNavigationPriority } from '@/cover/useCoverNavigationPriority';
import { useLiveSearchRouteScope } from '@/features/search';
import { useNowPlayingPrewarm } from '@/features/nowPlaying';
import { useOfflineAutoNav } from '@/features/offline';
+1 -1
View File
@@ -31,7 +31,7 @@ import {
usePerfOverlayMode,
} from '@/utils/perf/perfOverlayMode';
import { useAnalysisPerfListener } from '@/hooks/useAnalysisPerfListener';
import { useCoverPerfListener } from '@/hooks/useCoverPerfListener';
import { useCoverPerfListener } from '@/cover/useCoverPerfListener';
import { getCoverCachedPerMinute, getCoverUiPerMinute } from '@/utils/perf/coverPerfStore';
const SAMPLE_MS = 500;
+1 -1
View File
@@ -26,7 +26,7 @@ import { bootstrapAllIndexedServers } from '@/lib/library/librarySession';
import { hydrateQueueFromIndex } from '@/features/playback/store/queueRestore';
import { useLibraryAnalysisBackfill } from '@/lib/library/hooks/useLibraryAnalysisBackfill';
import { useCoverArtPrefetch } from '../cover/useCoverArtPrefetch';
import { useLibraryCoverBackfill } from '../hooks/useLibraryCoverBackfill';
import { useLibraryCoverBackfill } from '@/cover/useLibraryCoverBackfill';
import { useCoverRevalidateScheduler } from '../cover/useCoverRevalidateScheduler';
import { runCoverIdbUpgradeMigration } from '../utils/migrations/coverIdbUpgradeMigration';
import { useMigrationOrchestrator } from '../hooks/useMigrationOrchestrator';
@@ -3,7 +3,7 @@ import { useLocation } from 'react-router-dom';
import {
coverTrafficBeginNavigation,
coverTrafficEndNavigation,
} from '../cover/coverTraffic';
} from '@/cover/coverTraffic';
/**
* On route change: cancel queued peek/ensure/prefetch from the old page and
@@ -1,7 +1,7 @@
import { useEffect } from 'react';
import { listen } from '@tauri-apps/api/event';
import { coverGetPipelineQueueStats } from '../api/coverCache';
import { recordCoverProgress, recordCoverUiTotal } from '../utils/perf/coverPerfStore';
import { coverGetPipelineQueueStats } from '@/api/coverCache';
import { recordCoverProgress, recordCoverUiTotal } from '@/utils/perf/coverPerfStore';
/** How often to sample the backend's cumulative on-demand (UI) ensure count. */
const UI_POLL_MS = 1000;
@@ -6,13 +6,13 @@ import {
libraryCoverBackfillRunFullPass,
libraryCoverBackfillSetBaseUrl,
librarySqlServerId,
} from '../api/coverCache';
} from '@/api/coverCache';
import { coverStrategyAllowsLibraryBackfill } from '@/lib/library/coverStrategy';
import { useAuthStore } from '../store/authStore';
import { useCoverStrategyStore } from '../store/coverStrategyStore';
import { useAuthStore } from '@/store/authStore';
import { useCoverStrategyStore } from '@/store/coverStrategyStore';
import { subscribeLibraryCoverBackfillWake } from '@/lib/library/coverBackfillWake';
import { serverIndexKeyForProfile } from '../utils/server/serverIndexKey';
import { subscribeConnectCache } from '../utils/server/serverEndpoint';
import { serverIndexKeyForProfile } from '@/utils/server/serverIndexKey';
import { subscribeConnectCache } from '@/utils/server/serverEndpoint';
/**
* Library cover warm-up configure session in Rust; full pass runs natively.
@@ -3,8 +3,8 @@ import {
collectAlbumCoverWarmItems,
ensureAlbumCoverMisses,
warmCoverDiskSrcBatch,
} from '../cover/warmDiskPeek';
import type { CoverSurfaceKind } from '../cover/types';
} from '@/cover/warmDiskPeek';
import type { CoverSurfaceKind } from '@/cover/types';
const DEFAULT_LIMIT = 120;
+1 -1
View File
@@ -34,7 +34,7 @@ import { usePerfProbeFlags } from '@/utils/perf/perfFlags';
import { albumGridWarmCovers, COVER_DENSE_GRID_MIN_CELL_CSS_PX, GRID_COVER_WARM_LIMIT } from '@/cover/layoutSizes';
import { artistDetailCoverWarmAlbums } from '@/features/artist/components/topSongAlbumForCover';
import { useLibraryCoverPrefetch } from '@/cover/useLibraryCoverPrefetch';
import { useWarmGridCovers } from '@/hooks/useWarmGridCovers';
import { useWarmGridCovers } from '@/cover/useWarmGridCovers';
import { VirtualCardGrid } from '@/ui/VirtualCardGrid';
import { LOSSLESS_MODE_QUERY } from '@/lib/library/losslessMode';
import { sortArtistAlbumsByYear } from '@/features/artist/utils/sortArtistAlbums';
@@ -7,7 +7,7 @@ import { useTranslation } from 'react-i18next';
import { usePlayerStore } from '@/features/playback/store/playerStore';
import { queueSongStar, queueSongRating } from '@/features/playback/store/pendingStarSync';
import { useAlbumCoverRef, useArtistCoverRef } from '@/cover/useLibraryCoverRef';
import { usePlaybackCoverArt } from '@/hooks/usePlaybackCoverArt';
import { usePlaybackCoverArt } from '@/cover/usePlaybackCoverArt';
import { useCachedUrl } from '@/ui/CachedImage';
import { useArtistFanart } from '@/cover/useArtistFanart';
import { backdropFromConfig } from '@/cover/artistBackdrop';
@@ -1,4 +1,4 @@
import { usePlaybackCoverArt } from '@/hooks/usePlaybackCoverArt';
import { usePlaybackCoverArt } from '@/cover/usePlaybackCoverArt';
import { usePlaybackTrackCoverRef } from '@/cover/useLibraryCoverRef';
import { useEffect, useRef, useState } from 'react';
import { emit } from '@tauri-apps/api/event';
@@ -1,5 +1,5 @@
import { queueSongStar } from '@/features/playback/store/pendingStarSync';
import { usePlaybackCoverArt } from '@/hooks/usePlaybackCoverArt';
import { usePlaybackCoverArt } from '@/cover/usePlaybackCoverArt';
import { usePlaybackTrackCoverRef } from '@/cover/useLibraryCoverRef';
import type { Track } from '@/lib/media/trackTypes';
import { getPlaybackProgressSnapshot, subscribePlaybackProgress } from '@/features/playback/store/playbackProgress';
@@ -3,7 +3,7 @@ import { acquirePerfLivePoll, patchPerfLiveAnalysis } from '@/utils/perf/perfLiv
import { setPerfProbeTelemetryActive } from '@/utils/perf/perfTelemetry';
import { useAnalysisPerfLast } from '@/utils/perf/analysisPerfStore';
import { useAnalysisPerfListener } from '@/hooks/useAnalysisPerfListener';
import { useCoverPerfListener, useCoverUiThroughputPoll } from '@/hooks/useCoverPerfListener';
import { useCoverPerfListener, useCoverUiThroughputPoll } from '@/cover/useCoverPerfListener';
import {
getPerfProbeFlags,
subscribePerfProbeFlags,
-2
View File
@@ -1,2 +0,0 @@
/** @deprecated Import from `src/cover/usePlaybackCoverArt` — `displayCssPx` is CSS px, not tier. */
export { usePlaybackCoverArt } from '../cover/usePlaybackCoverArt';
+1 -1
View File
@@ -1,6 +1,6 @@
import React, { useCallback, useMemo, useRef } from 'react';
import { GRID_COVER_WARM_LIMIT } from '@/cover/layoutSizes';
import { useWarmGridCovers } from '@/hooks/useWarmGridCovers';
import { useWarmGridCovers } from '@/cover/useWarmGridCovers';
import { useVirtualizer } from '@tanstack/react-virtual';
import { APP_MAIN_SCROLL_VIEWPORT_ID } from '@/constants/appScroll';
import { useElementClientHeightById } from '@/lib/hooks/useResizeClientHeight';