Open
Conversation
Owner
|
Thanks for the useful feature, friend. I'll review it a little bit later. |
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.
New Videos Counter — Walkthrough
Summary
Implemented a new feature that displays a counter of new videos next to pinned channel names in the sidebar (e.g.
(3) MrBeast). The counter resets after focusing the channel for 5 seconds. The feature is opt-in via a toggle in Settings → Main UI → Misc.See #5435
Files Changed
mIsNewVideoCounterEnabledfield, getter/setter, persistencenew_video_counterstring resourcevalues-fr/strings.xml,values-es/strings.xmletc. translated the stringtimestamp_videoIdmNamenon-final and added setName() to resolve a refresh bug when replacingPageRowHow It Works
mCounterRefreshRunnable.{publishedDate}_{videoId}into NewVideoCounterData.videoIdin the list to determine exactly how many videos are above it (newer).aI6kku_Ol0w).videoIdis missing from the RSS feed (because it was deleted, or because there are 16+ new videos pushing it out of the 15-item feed), the app falls back to comparingpublishedDateto count how many videos in the new feed are strictly newer than the last known date.^\(\d+\)\s+to prevent infinite stacking (e.g.,(13)(13) Fox News), then prepends(N)to the clean channel name via updateSectionTitle().{publishedDate}_{videoId}and strips the counter.you can change this line to modify the timer:
mCounterResetHandler.postDelayed(mCounterResetRunnable, 5_000);Problems:
1.The RSS allow us to fetch only the last 15 videos. So the counter will never exceed 15.
DEBUG
If you want to debug this feature @yuliskov you should go to my github and fetch the debug branch, then using
logcat | grep VideoCounterDebugYou'll have this type of debug:
SCREEN: