feat(playlist-import): multipart playlists for 2000+ track imports

Qobuz limits playlists to 2000 tracks. When matched tracks exceed
this limit, the importer now automatically splits into multiple
playlists named "Playlist (Part 1)", "Playlist (Part 2)", etc.

- models.rs: qobuz_playlist_id -> qobuz_playlist_ids Vec, add parts_created
- importer.rs: chunk matched tracks by 2000, create playlist per chunk
- Frontend: show parts count in summary, move all parts to folder
- i18n: add partsCreated key in en/es/de/fr
This commit is contained in:
vicrodh committed 2026-02-09 18:43:46 -06:00
1 parent 595d6d46f5
commit 4bbf97a131
7 files changed
+89 -38

No files matched your search

+18 -5
View File
@@ -38,7 +38,8 @@
total_tracks: number;
matched_tracks: number;
skipped_tracks: number;
qobuz_playlist_id?: number | null;
qobuz_playlist_ids: number[];
parts_created: number;
}
interface Props {
@@ -255,12 +256,21 @@
lastImportedUrl = previewUrl;
pushLog(`Imported ${result.matched_tracks} of ${result.total_tracks} tracks into QBZ.`, 'success');
if (result.qobuz_playlist_id) {
pushLog('Playlist created in Qobuz\u2122.', 'success');
if (result.qobuz_playlist_ids.length > 0) {
if (result.parts_created > 1) {
pushLog(
$t('playlistImport.partsCreated', { values: { count: result.parts_created } }),
'success'
);
} else {
pushLog('Playlist created in Qobuz\u2122.', 'success');
}
// Move to folder if selected
// Move all parts to folder if selected
if (selectedFolderId) {
await movePlaylistToFolder(result.qobuz_playlist_id, selectedFolderId);
for (const playlistId of result.qobuz_playlist_ids) {
await movePlaylistToFolder(playlistId, selectedFolderId);
}
}
} else {
pushLog('No matching tracks found.', 'error');
@@ -438,6 +448,9 @@
<div class="summary-row">{$t('playlistImport.playlistLabel', { values: { name: summary.playlist_name } })}</div>
<div class="summary-row">{$t('playlistImport.tracksMatched', { values: { matched: summary.matched_tracks, total: summary.total_tracks } })}</div>
<div class="summary-row">{$t('playlistImport.skipped', { values: { count: summary.skipped_tracks } })}</div>
{#if summary.parts_created > 1}
<div class="summary-row">{$t('playlistImport.partsCreated', { values: { count: summary.parts_created } })}</div>
{/if}
</div>
{/if}
</div>
+2 -1
View File
@@ -1323,6 +1323,7 @@
"matchingPhase": "Qobuz-Katalog durchsuchen...",
"creatingPhase": "Playlist erstellen...",
"addingPhase": "Titel zur Playlist hinzufugen...",
"addingProgress": "Titel hinzufugen: {current} / {total}"
"addingProgress": "Titel hinzufugen: {current} / {total}",
"partsCreated": "Aufgeteilt in {count} Playlists (Qobuz-Limit: 2000 Titel)"
}
}
+2 -1
View File
@@ -1525,6 +1525,7 @@
"matchingPhase": "Searching Qobuz catalog...",
"creatingPhase": "Creating playlist...",
"addingPhase": "Adding tracks to playlist...",
"addingProgress": "Adding tracks: {current} / {total}"
"addingProgress": "Adding tracks: {current} / {total}",
"partsCreated": "Split into {count} playlists (Qobuz 2000-track limit)"
}
}
+2 -1
View File
@@ -1525,6 +1525,7 @@
"matchingPhase": "Buscando en el catalogo de Qobuz...",
"creatingPhase": "Creando playlist...",
"addingPhase": "Agregando tracks a la playlist...",
"addingProgress": "Agregando tracks: {current} / {total}"
"addingProgress": "Agregando tracks: {current} / {total}",
"partsCreated": "Dividida en {count} playlists (limite de 2000 tracks en Qobuz)"
}
}
+2 -1
View File
@@ -1323,6 +1323,7 @@
"matchingPhase": "Recherche dans le catalogue Qobuz...",
"creatingPhase": "Creation de la playlist...",
"addingPhase": "Ajout des titres a la playlist...",
"addingProgress": "Ajout des titres : {current} / {total}"
"addingProgress": "Ajout des titres : {current} / {total}",
"partsCreated": "Divisee en {count} playlists (limite Qobuz : 2000 titres)"
}
}