Repository navigation
Conversation
playlistItems.list on the uploads playlist can return the same video on more than one page. videos list printed every copy. Keep the first copy per video id, keep the API order, and count only unique videos toward --limit. The same guard goes on the other paged reads: search-replace and playlists add --from-search (dedupe on video id, so no video is updated or added twice) and playlist item listing (dedupe on playlist item id, because a playlist can hold the same video twice on purpose).
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #59 +/- ##
==========================================
+ Coverage 85.03% 85.66% +0.62%
==========================================
Files 15 15
Lines 2660 2686 +26
Branches 393 401 +8
==========================================
+ Hits 2262 2301 +39
+ Misses 264 258 -6
+ Partials 134 127 -7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This branch has not been deployed
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.
Fixes #58
Problem
videos listalready reads the uploads playlist withplaylistItems.listandpageToken. The API itself can return the same video on more than one page of that playlist (also reported on Stack Overflow forUU...playlists). The CLI printed every copy, so--limit 500showed some videos two or three times.Change
videos list: keep the first copy of each video id, in API order.--limitcounts unique videos.videos.listis called only for new ids.videos search-replaceandplaylists add --from-search: same dedupe on video id, so a video is never updated or added twice.Tests
Regression tests use a fake offset-paged uploads playlist with repeated entries across pages (JSON, CSV,
--limit), plus overlapping search and playlist item pages. They fail on main and pass here.Limit
Dedupe removes the repeats. If the API also leaves some videos out of the uploads playlist pages, the CLI cannot show those; the reporter's count (164 unique out of 230 rows) is worth checking against the channel's real video count.