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

Deduplicate code for fetching stream info when sparse #7981

Merged
merged 2 commits into from Mar 16, 2022

Conversation

Stypox
Copy link
Member

@Stypox Stypox commented Mar 3, 2022

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

As explained in #7941 the method to fetch stream info item if sparse and to fetch uploader url if missing worked basically the same way, by fetching the StreamInfo if needed. This PR unifies those two methods in SparseItemUtil. They now show a toast with the correct information ("Fetching stream details" instead of "Fetching channel details"), and does so not only when loading uploader url but also when loading stream info before (en)queueing. I also fixed the way streams are saved to database: instead of only saving the channel url or saving the whole stream but setting its watch duration to 0 uselessly, now the stream info is upserted in the DB fully and without side effects. I also removed an unused related string.

Fixes the following issue(s)

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.

Due diligence

@AudricV AudricV added the codequality Improvements to the codebase to improve the code quality label Mar 3, 2022
Copy link
Member

@AudricV AudricV left a comment

Choose a reason for hiding this comment

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

Note that I didn't really take a look at the real code in my review, one about it is necessary.

@Stypox
Copy link
Member Author

Stypox commented Mar 3, 2022

@TiA4f8R I disagree with all of your review except for the @NonNull and possibly the alignment of the parameters ;-)

Copy link
Member

@litetex litetex left a comment

Choose a reason for hiding this comment

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

LGTM, only one minor thing.

Btw how can I test the changes?

@Stypox
Copy link
Member Author

Stypox commented Mar 15, 2022

I solved or answered your comments, thank you for the reviews

@litetex
Copy link
Member

litetex commented Mar 15, 2022

@Stypox
I think you didn't answer my questions and suggestions...

@Stypox
Copy link
Member Author

Stypox commented Mar 15, 2022

Oh, I missed the "how can I test the changes" (but I did implement the suggestion and forgot to push it, see latest commit). Shall I create a database in which the feed has some items with missing data?

@sonarcloud
Copy link

sonarcloud bot commented Mar 15, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@litetex
Copy link
Member

litetex commented Mar 15, 2022

Oh, I missed the "how can I test the changes" (but I did implement the suggestion and forgot to push it, see latest commit). Shall I create a database in which the feed has some items with missing data?

You can if you want 😄

@Stypox
Copy link
Member Author

Stypox commented Mar 16, 2022

Here it is: just import, open the feed fragment and reload the feed and you will get a bunch of videos with missing data. If you then want to test videos with all data, just disable fast loading and reload. NewPipeData-20220316_112803.zip

Copy link
Member

@litetex litetex left a comment

Choose a reason for hiding this comment

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

LGTM

Code ✔️
Test ✔️

@litetex litetex merged commit 37aca3f into TeamNewPipe:dev Mar 16, 2022
@Stypox Stypox mentioned this pull request Apr 16, 2022
12 tasks
@Stypox Stypox deleted the sparse-items-deduplic branch August 4, 2022 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codequality Improvements to the codebase to improve the code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicated methods that fetch full info for sparse streams
4 participants