Repository navigation
Conversation
Watch Later tracks that arrive through sync or import commonly lack a duration, view count or publish date (Android's sync payload carries no views or date), so they showed no length badge and could not be sorted. The playlist page now enriches them from video details, ported from Flow-Android's PlaylistDetailViewModel.enrichStubs: - only for playlists stored in the library; - at most 50 untried tracks per visit, fetched one at a time in chunks of 5 with a 300 ms pause, never two passes at once; - fresh details replace stored values, like updateVideoMetadata, keeping any field the details lack; - a pass stops once its playlist leaves the screen, as the view model's scope would. Two deliberate differences: any track missing a duration, view count or publish date is a target, on every visit (Android only picks tracks with no title; its WatchLaterMetadataMigrator refreshes titled Watch Later tracks once, so tracks synced in later stay incomplete there), and results are saved per chunk rather than per video, because the desktop library is one stored blob. Saves go through an updater, so a reorder or removal made meanwhile survives. The page now sorts and reorders the hook's list directly instead of a local copy, which every enriched chunk overwrote, undoing a drag reorder made during a pass. `updateStoredPlaylistTracks` accepts an updater, skips the write when the updater returns the same array, and keeps a saved playlist's full count text instead of overwriting it with the length of its stored tracks, which can be a partial copy of the playlist. Assisted-by: Claude Code (Claude Opus 5.5)
AmyJeanes
force-pushed
the
pr/playlist-metadata-backfill
branch
from
October 25, 2026 18:05
44d1881 to
60d8059
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Playlist tracks that arrive through sync or import often have no length, view count or upload date: Android's sync payload carries no views or date, and relative dates like "7 hours ago" are frozen at sync time. Those tracks showed no length badge, never got fixed, and sorted badly. The playlist page now fills them in from each video's details, ported from Flow-Android.
playlistEnrichment.ts(new): which tracks need details (needsEnrichment) and how fresh details merge into a stored track (applyVideoDetails), plus Android's limits.usePlaylistDetails.ts:enrichTracksruns one pass per visit for playlists stored in the library: at most 50 untried tracks, one lookup at a time in chunks of 5 with a 300 ms pause. Each chunk is saved as it arrives, and the pass stops when the playlist leaves the screen.playlistLibrary.ts:updateStoredPlaylistTrackstakes an updater, so a chunk is applied to what is stored at that moment and a reorder or removal made during a pass survives. It skips the write when nothing changed, and keeps a saved playlist's full count ("411 videos") instead of overwriting it with the number of stored tracks, which for a playlist saved before fix(playlist): page past 100 videos, channel search pages and reply threads #160 is only the first page.PlaylistDetailsPage.tsx: sorts and reorders the hook's list directly instead of a local copy, which every enriched chunk overwrote, undoing a drag made during a pass.Android parity. Ported from
PlaylistDetailViewModel.enrichStubs(same 50-track limit, chunk size, pause, one pass at a time, failures skipped). Differences:WatchLaterMetadataMigrator, so tracks synced in after that stay incomplete. Desktop picks any track missing a length, view count or upload date, on every visit and in every stored playlist, which covers the migrator's case without a one-time job.updateVideoMetadataoverwrites stored fields; here a field the fresh details lack keeps its stored value.Related issue
None filed.
Change type
Validation
Windows 11 x64.
pnpm test(75 files, 377 tests passed)pnpm buildcargo fmt --manifest-path src-tauri/Cargo.toml --all -- --check(no Rust changes)cargo clippy --manifest-path src-tauri/Cargo.toml --all-targets --all-features(no Rust changes)cargo test --manifest-path src-tauri/Cargo.toml --all-targets --all-features(no Rust changes)Smoke test against a
mainbuild, with the same saved 100-track playlist stripped of lengths, views and dates in both: onmainnothing fills in. On this branch the tracks fill in one at a time (about one every 3 s on currentmain) and are saved as they arrive; a visit stops after 50 lookups and the next visit continues, leaving a visit mid-pass stops it. A drag reorder made during a pass is kept on screen and in storage, the saved count stays "411 videos", and two videos YouTube won't return details for stay blank without breaking the pass. A real Watch Later synced from Android onmainhad 11 of 41 tracks with no views and frozen relative dates. Retested after rebasing onto #160: the same results, a playlist not in the library still makes no lookups and pages as before, and a newly saved 1009-video playlist looks up only the tracks missing details.Screenshots or recordings
mainfirst, then this branch:playlist-enrich-demo.mp4
Risk and compatibility
Frontend only, no migrations or new strings. Network: up to 50 video-details lookups per playlist visit, one at a time at Android's pace, only for playlists stored in the library and only for tracks still missing details; tracks that fail are not retried until the next visit.
AI disclosure: This PR was largely written by Claude (Opus 5.5) but was fully reviewed and tested by myself before raising this.