feat(local-library): implement playback context tracking

Add proper context tracking for Local Library playback so the stack
icon shows correctly when playing from Local Library.

Changes:
- Add 'local_library' to ContextType enum (frontend and backend)
- Add 'Local Library' display label in context info
- Import setPlaybackContext in LocalLibraryView
- Call setPlaybackContext when playing tracks from Local Library
  - For album view: context is the album with album title
  - For tracks view: context is "Local Tracks"
- Track IDs and position are properly set for context navigation

Fixes issue where Local Library playback showed stale Qobuz context.

cc
This commit is contained in:
vicrodh committed 2026-01-19 18:17:04 -06:00
1 parent 873dcee10e
commit f2c3e8aedd
3 files changed
+32 -2

No files matched your search

+3 -2
View File
@@ -9,7 +9,7 @@ import { invoke } from '@tauri-apps/api/core';
// ============ Types ============
export type ContextType = 'album' | 'playlist' | 'artist_top' | 'home_list' | 'favorites';
export type ContextType = 'album' | 'playlist' | 'artist_top' | 'home_list' | 'favorites' | 'local_library';
export type ContentSource = 'qobuz' | 'local';
export interface PlaybackContext {
@@ -138,7 +138,8 @@ export function getContextDisplayInfo(): string | null {
playlist: 'Playlist',
artist_top: 'Artist Top Songs',
home_list: 'Home List',
favorites: 'Favorites'
favorites: 'Favorites',
local_library: 'Local Library'
}[currentContext.type];
return `${typeStr} · ${currentContext.label}`;