Update subscription view to be able to load videos from video cache again #3665
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.
Pull Request Type
Related issue
There is another caching strategy in #3668
Description
This is a change as base for adding live stream tab for subscription view
The original plan is to only refactor the code first but some existing code/feature seems disabled (intentionally or accidentally I am not sure)
Load videos from video cache
When videos for all subscriptions loaded (main profile), there is some code (though disabled due to bug) to cache all loaded videos and use those when active profile changed
The flow in this PR is like:
subscriptionsCacheForActiveProfile
)subscriptionsCacheForAllSubscriptionsProfile
)subscriptionsCacheForAllSubscriptionsProfile
subscriptionsCacheForActiveProfile
if profile ID matchessubscriptionsCacheForAllSubscriptionsProfile
has videos cached it would load videos from it with filtering (video channel is in active profile)Screenshots
For loading from
subscriptionsCacheForAllSubscriptionsProfile
Screen.Recording.2023-06-14.at.14.28.21.mov
Testing
Preparation:
Before starting each test please reopen window/app/refresh to ensure local state is reset
A. Auto fetching disabled
A1. Loading from
subscriptionsCacheForAllSubscriptionsProfile
A2. Auto clearing of
subscriptionsCacheForAllSubscriptionsProfile
& Loading fromsubscriptionsCacheForActiveProfile
B. Auto fetching enabled
B1. Loading from
subscriptionsCacheForAllSubscriptionsProfile
Load videos from remote
is done automaticallyB2. Auto clearing of
subscriptionsCacheForAllSubscriptionsProfile
& Loading fromsubscriptionsCacheForActiveProfile
Desktop
Additional context
Refactoring code and typing test cases & testing might be more tiring than actual implementation