-
Notifications
You must be signed in to change notification settings - Fork 887
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update subscription cache when visiting a channel #4667
Merged
Merged
Conversation
This file contains 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
absidue
requested review from
PikachuEXE,
efb4f5ff-1298-471a-8973-3d47447115dc,
ChunkyProgrammer,
kommunarr and
MarmadileManteater
February 11, 2024 17:29
github-actions
bot
added
the
PR: waiting for review
For PRs that are complete, tested, and ready for review
label
Feb 11, 2024
If this is merged first, #4380 will need to test about this |
PikachuEXE
approved these changes
Feb 12, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition I also tested:
- Create/choose profile with >1 profile (auto fetch sub disabled)
- Confirm no sub shown
- Visit 1 channel
- Confirm no sub shown
- Visit remaining channels
- Confirm sub (& others) shown
1 task
1 task
ChunkyProgrammer
approved these changes
Feb 28, 2024
efb4f5ff-1298-471a-8973-3d47447115dc
approved these changes
Mar 1, 2024
github-actions
bot
removed
the
PR: waiting for review
For PRs that are complete, tested, and ready for review
label
Mar 1, 2024
PikachuEXE
added a commit
to PikachuEXE/FreeTube
that referenced
this pull request
Mar 4, 2024
* development: (29 commits) Translated using Weblate (Chinese (Traditional)) Fix URL copied via right click menu (FreeTubeApp#4690) Translated using Weblate (Croatian) Wrap ft-icon buttons below before they go fully vertical (FreeTubeApp#4735) * Make activating a chapter selector makes window scroll to top like clicking on timestamp links (FreeTubeApp#4722) Translated using Weblate (Portuguese (Brazil)) Translated using Weblate (Portuguese (Brazil)) Make video thumbnails have certain height before image loading starts to avoid layout shifts (FreeTubeApp#4723) Update subscription cache when visiting a channel (FreeTubeApp#4667) Fix fallback to Invidious for the podcasts channel tab (FreeTubeApp#4731) Translated using Weblate (Portuguese (Brazil)) Translated using Weblate (Arabic) Translated using Weblate (Polish) Translated using Weblate (Dutch) Translated using Weblate (Icelandic) Translated using Weblate (Spanish) Translated using Weblate (Arabic) Translated using Weblate (Icelandic) Translated using Weblate (Italian) Translated using Weblate (Chinese (Simplified)) ...
4 tasks
1 task
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.
Update subscription cache when visiting a channel
Pull Request Type
Description
Currently when you visit a channel, we fetch the latest information from YouTube and display it to the user, we also update the channel name and thumbnail in the subscriptions database. What we don't do yet is update the subscriptions cache with the videos, shorts, live and community post content that we got.
This pull request changes the channel page, so that it updates the subscription cache with the information on the channel page. For the videos, live and community tabs, we just overwrite the current cache for that channel, as what we just received is the last known state (same as what a refresh on the subscriptions page would do). For the shorts tab we unfortunately cannot do that, as the shorts channel tab doesn't have published dates (we need them for sorting on the subscriptions page), on the subscriptions page we always use RSS for the shorts tab, instead this pull request will just update the title, channel name and view count of the existing items in the cache.
You might be wondering what the point of this is, as we don't syncronise the subscription cache across windows (each window has it's own one #4152) and don't persist it on disk, so they disappear between app launches. This is basically a "free" subscription refresh for the visited channel as we already have the information without making any additional API requests. It will mostly benefit users that use the same window for a long time, but will help if we do implement synchronisation across windows in the future or disk persistence, as it would also allow us to reduce API requests (e.g. this channel was refreshed less than 1 minute ago, no need to fetch it again).
Testing
As waiting for any of your subscribed channels to upload a new video would be a slow and unpredictable test case, here are two that allow you to skip the waiting.
Please note that all steps for a given test case have to be performed in the same window, as we don't synchronise the subscription cache between windows yet
Test case 1
This test case will require you to have DeArrow disabled and either not have any watch history or for you to pick a channel that has videos that you haven't watched.
Fetch feeds from RSS
in theSubscription Settings
sectionTest case 2
Fetch feed automatically
in theSubscription Settings
sectionDesktop