feat(import): playlist files, JSON, ListenBrainz and Last.fm as import sources
Implements qbz-nix-docs/deferred-2.0.3/playlist-importer-expansion-design.md, whose §11 the owner ratified 2026-07-31. PlaylistSource is an enum, not a trait (ADR-007): the set is closed, there is no plugin story, and every arm resolves to the same ImportPlaylist the URL scrapers already produce — so the matcher, the 2000-track split, the sink and the summary never learn a second kind of source exists. import_prepared_playlist takes the playlist BY VALUE and import_public_playlist becomes a shim. That kills the double scrape the Tauri re-fetch-on-execute left behind, and it is not optional for the new sources: the rfd bytes of a picked file are gone by execute time and the dialog cannot silently reopen. It also closes a real race — open() resets the session, so a modal reopened between the Import click and the task's read handed a detached task None. FILES read the track list ONLY. The paths inside are never opened, copied or added to the Local Library, and the modal says so in a persistent row rather than a tooltip. Content sniffing beats the extension, with an HLS guard because .m3u8 is also the stream-manifest extension, and a utf8-then-Windows-1252 fallback because .m3u and .pls predate UTF-8 and "Björk" has to stay matchable. JSON locates the track list BY SHAPE. Depth is a DoS bound, not a locator: the array sits at 0, 1, 2 or 3 levels depending on the export, and a hard two-level rule drops an ordinary GraphQL envelope. Container demotion keeps a discography from importing album names as track titles. Walls at 16 MiB, depth 8, 2M nodes and 10k tracks. SERVICES are public reads with no authentication; a connected account only prefills the field. No qbz-integrations edge — its ListenBrainz client returns tracks with no duration and drops the playlist title, both verified in its source, and a direct GET /1/playlist/<mbid> reads all three in one request. A Last.fm STATION IS A RADIO, and ?page=N is not pagination. Measured against a live profile: pages 1 and 2 overlapped and batch sizes varied (20, 20, 36). The first cut fetched 20 pages, never hit its empty-page exit, and returned 469 rows holding 198 distinct tracks. It now dedupes as it draws, stops after two dry draws, and stops at MAX_STATION_TRACKS = 200 — the number shown in "Found N tracks" has to be one we can deliver, and a station is dynamic enough that a bigger single import buys little (owner ruling: no false expectations of "traeré casi 500" when we bring half). A failed draw no longer fails an import that already has rows; Last.fm rate-limits a burst of these. The summary reports THREE DISJOINT NUMBERS that sum to the total. skipped is now counted from the matches that found nothing, not inferred as total - matched, which folded duplicates into failures: that same import told the user 271 tracks were skipped when 255 of them had matched perfectly well and been deduplicated before the add. 23 new strings across the seven translated locales; en is the sparse fallback catalogue and needs none. cc
This commit is contained in:
27 files changed
+4212
-34
No files matched your search
@@ -5315,3 +5315,77 @@ msgstr "Клик по разделу в боковой панели или за
|
||||
# Discover configurator: per-rail default item count (2026-08-19)
|
||||
msgid "Default ({})"
|
||||
msgstr "По умолчанию ({})"
|
||||
|
||||
# Playlist importer expansion (2.0.3): file / JSON / ListenBrainz / Last.fm sources
|
||||
|
||||
msgid "Streaming URL"
|
||||
msgstr "URL стриминга"
|
||||
|
||||
msgid "Playlist file"
|
||||
msgstr "Файл плейлиста"
|
||||
|
||||
msgid "JSON file"
|
||||
msgstr "Файл JSON"
|
||||
|
||||
msgid "ListenBrainz"
|
||||
msgstr "ListenBrainz"
|
||||
|
||||
msgid "Last.fm"
|
||||
msgstr "Last.fm"
|
||||
|
||||
msgid "Choose file…"
|
||||
msgstr "Выбрать файл…"
|
||||
|
||||
msgid "No file selected"
|
||||
msgstr "Файл не выбран"
|
||||
|
||||
msgid "Only the track list is read — the referenced audio files are never opened, copied, or added to your Local Library. Each entry is matched against the Qobuz catalog."
|
||||
msgstr "Читается только список треков — указанные аудиофайлы никогда не открываются, не копируются и не добавляются в локальную библиотеку. Каждая запись сопоставляется с каталогом Qobuz."
|
||||
|
||||
msgid "JSON is read best-effort — check the track count below before importing."
|
||||
msgstr "JSON читается по мере возможности — проверьте количество треков перед импортом."
|
||||
|
||||
msgid "Could not read the file."
|
||||
msgstr "Не удалось прочитать файл."
|
||||
|
||||
msgid "No tracks found in the file."
|
||||
msgstr "В файле не найдено треков."
|
||||
|
||||
msgid "Unrecognized file format — use XSPF, PLS, M3U/M3U8, or JSON."
|
||||
msgstr "Формат файла не распознан — используйте XSPF, PLS, M3U/M3U8 или JSON."
|
||||
|
||||
msgid "This looks like a live-stream manifest, not a playlist."
|
||||
msgstr "Похоже, это манифест прямой трансляции, а не плейлист."
|
||||
|
||||
msgid "That file is too large to import."
|
||||
msgstr "Этот файл слишком велик для импорта."
|
||||
|
||||
msgid "Could not recognize a track list in this JSON."
|
||||
msgstr "Не удалось распознать список треков в этом JSON."
|
||||
|
||||
msgid "Username or profile URL"
|
||||
msgstr "Имя пользователя или URL профиля"
|
||||
|
||||
msgid "Username or playlist URL"
|
||||
msgstr "Имя пользователя или URL плейлиста"
|
||||
|
||||
msgid "Play your library"
|
||||
msgstr "Слушать вашу библиотеку"
|
||||
|
||||
msgid "Play your mix"
|
||||
msgstr "Слушать ваш микс"
|
||||
|
||||
msgid "Play your recommendations"
|
||||
msgstr "Слушать ваши рекомендации"
|
||||
|
||||
msgid "Station"
|
||||
msgstr "Станция"
|
||||
|
||||
msgid "No playlists found for {}."
|
||||
msgstr "Плейлисты для {} не найдены."
|
||||
|
||||
msgid "Enter a public username."
|
||||
msgstr "Введите публичное имя пользователя."
|
||||
|
||||
msgid "Duplicates: {}"
|
||||
msgstr "Дубликаты: {}"
|
||||
Reference in new issue
Block a user