feat(playlist-import): integrate Codex playlist import feature
Cherry-pick and integrate playlist import from playlist-import-impl branch: - Add playlist_import Rust module with providers (Spotify, Apple, Tidal, Deezer) - Add track matching algorithm (ISRC first, then fuzzy matching) - Add PlaylistImportModal.svelte with progress log UI - Wire up import button in Sidebar - Add modal state management in uiStore - Register Tauri commands for preview and execute Original implementation by Codex, integrated manually due to branch divergence.
This commit is contained in:
1 parent
4b7e6b9c17
commit
22cf6d9051
17 files changed
+1932
-2
No files matched your search
@@ -14,6 +14,7 @@ let isCastPickerOpen = false;
|
||||
let isPlaylistModalOpen = false;
|
||||
let playlistModalMode: 'create' | 'edit' | 'addTrack' = 'create';
|
||||
let playlistModalTrackIds: number[] = [];
|
||||
let isPlaylistImportOpen = false;
|
||||
|
||||
// Listeners
|
||||
const listeners = new Set<() => void>();
|
||||
@@ -144,6 +145,22 @@ export function closePlaylistModal(): void {
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
// ============ Playlist Import Modal ============
|
||||
|
||||
export function getPlaylistImportOpen(): boolean {
|
||||
return isPlaylistImportOpen;
|
||||
}
|
||||
|
||||
export function openPlaylistImport(): void {
|
||||
isPlaylistImportOpen = true;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
export function closePlaylistImport(): void {
|
||||
isPlaylistImportOpen = false;
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
// ============ Escape Key Handler ============
|
||||
|
||||
/**
|
||||
@@ -171,6 +188,10 @@ export function handleEscapeKey(): boolean {
|
||||
closePlaylistModal();
|
||||
return true;
|
||||
}
|
||||
if (isPlaylistImportOpen) {
|
||||
closePlaylistImport();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -184,6 +205,7 @@ export interface UIState {
|
||||
isPlaylistModalOpen: boolean;
|
||||
playlistModalMode: 'create' | 'edit' | 'addTrack';
|
||||
playlistModalTrackIds: number[];
|
||||
isPlaylistImportOpen: boolean;
|
||||
}
|
||||
|
||||
export function getUIState(): UIState {
|
||||
@@ -194,6 +216,7 @@ export function getUIState(): UIState {
|
||||
isCastPickerOpen,
|
||||
isPlaylistModalOpen,
|
||||
playlistModalMode,
|
||||
playlistModalTrackIds
|
||||
playlistModalTrackIds,
|
||||
isPlaylistImportOpen
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user