refactor(favorites): centralize track favorites in favoritesStore
- Create favoritesStore.ts for centralized favorites state management - Refactor TrackRow to be self-sufficient with internal favorites handling - TrackRow now subscribes to store and toggles favorites internally - Remove redundant favoriteTrackIds state from AlbumDetailView and PlaylistDetailView - Remove manual onAddFavorite prop drilling from all views - Add trackId prop to TrackRow for store lookup (optional for local tracks) - Add hideFavorite prop for local tracks that don't have Qobuz IDs - Load favorites once on app init in +page.svelte
This commit is contained in:
1 parent
48a010c597
commit
1b90a45212
8 files changed
+229
-67
No files matched your search
@@ -486,6 +486,7 @@
|
||||
duration={formatDuration(track.duration_secs)}
|
||||
quality={getQualityBadge(track)}
|
||||
hideDownload={true}
|
||||
hideFavorite={true}
|
||||
onPlay={() => handleTrackPlay(track)}
|
||||
menuActions={{
|
||||
onPlayNow: () => handleTrackPlay(track),
|
||||
@@ -698,6 +699,7 @@
|
||||
duration={formatDuration(track.duration_secs)}
|
||||
quality={getQualityBadge(track)}
|
||||
hideDownload={true}
|
||||
hideFavorite={true}
|
||||
onPlay={() => handleTrackPlay(track)}
|
||||
menuActions={{
|
||||
onPlayNow: () => handleTrackPlay(track),
|
||||
|
||||
Reference in new issue
Block a user