Skip to content
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

Calculate cache key based on info type instead of item type #10717

Merged
merged 2 commits into from
Mar 28, 2024

Conversation

Stypox
Copy link
Member

@Stypox Stypox commented Dec 30, 2023

What is it?

  • Bugfix (user facing)
  • Feature (user facing)
  • Codebase improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

It didn't really make sense to consider two cache keys as equal based on the type of items contained within that list. The proper way is to distinguish the actual kind of Info being saved/retrieved, so I created a new enum independent from the extractor's one

This PR includes the extractor from TeamNewPipe/NewPipeExtractor#1148 to showcase that the problem is fixed, since there MediaCCC channels and channel tabs have the same url.

APK testing

The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR. You can find more info and a video demonstration on this wiki page.

Due diligence

It didn't really made sense to consider two cache keys as equal based on the type of items contained within that list.
Copy link

sonarcloud bot commented Dec 30, 2023

@Stypox Stypox added bug Issue is related to a bug channel Anything to do with creator channels in the app size/medium PRs with less than 250 changed lines labels Dec 30, 2023
Copy link
Member

@TobiGr TobiGr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
InfoCache does not need to be reset after applying these changes because it has a lifetime of one session. Is this correct?

@Stypox
Copy link
Member Author

Stypox commented Mar 28, 2024

InfoCache does not need to be reset after applying these changes because it has a lifetime of one session. Is this correct?

Yes, and also if it wasn't correct, all cache keys would have changed so there won't be conflicts

@Stypox Stypox merged commit e0268a9 into TeamNewPipe:dev Mar 28, 2024
9 of 11 checks passed
@Stypox Stypox mentioned this pull request Apr 1, 2024
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is related to a bug channel Anything to do with creator channels in the app size/medium PRs with less than 250 changed lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants