-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Load uploaderUrl when showing Channel Details from Play Queue #7538
Load uploaderUrl when showing Channel Details from Play Queue #7538
Conversation
Detected a Assuming this PR is not yet in a reviewable state and converted it to a draft. |
Basically take a look at the |
@litetex Unfortunately, I'm not sure there's a good way to show the error. Using I tried using ErrorPanelHelper, but that doesn't work because this part of the code doesn't have access to a Fragment. I also can't use |
Do you have an idea how to fix this? |
@ktprograms I don't know if it would be possible to open a snackbar in that case. In order to open a snackbar you need a If doing these things turns out to require changing too many lines and duplicate too much code, just use an error notification, that can be shown just by using a context. |
@Stypox I'll look more into this tomorrow, but what do you mean by |
Would it be better to merge this first as it fixes the bug that the channel details aren't properly loaded, and move the error handling to another PR? (BTW the TODO was from my first PR about |
@ktprograms just replace |
37762f5
to
835e2f2
Compare
Done. Ready for review, please. |
835e2f2
to
c39c0b1
Compare
Then this doesn't need to be a draft anymore. |
c39c0b1
to
b0f2287
Compare
app/src/main/java/org/schabi/newpipe/util/SaveUploaderUrlHelper.java
Outdated
Show resolved
Hide resolved
b0f2287
to
607d995
Compare
Kudos, SonarCloud Quality Gate passed! |
app/src/main/java/org/schabi/newpipe/util/SaveUploaderUrlHelper.java
Outdated
Show resolved
Hide resolved
607d995
to
973fd8f
Compare
app/src/main/java/org/schabi/newpipe/util/SaveUploaderUrlHelper.java
Outdated
Show resolved
Hide resolved
This checks if the uploaderUrl is in the database, if not it gets the uploaderUrl and puts it in the database. This is similar to the fetching of uploaderUrl when it doesn't exist done in TeamNewPipe#6919. Also use createNotification when error occurs in getStreamInfo.
973fd8f
to
1e652b1
Compare
How would I fix this warning: https://sonarcloud.io/project/issues?id=TeamNewPipe_NewPipe&issues=AX6PN5ztwvdSy9w-T0sr&open=AX6PN5ztwvdSy9w-T0sr&pullRequest=7538 ? It is in the else branch of |
That does not seem to be possible for you: https://community.sonarsource.com/t/sonarqube-does-not-detect-null-check-by-a-method-and-showing-possible-nullpointerexception/28809 |
Ok, thanks!
|
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.
Code looks good, thank you! I tested and it works well (even though now the problem with QueueItemMenuUtil
is already disappeared thanks to #7036 which makes sure items with full stream info to be enqueued).
Thanks!
|
This checks if the uploaderUrl is in the database, if not it gets the
uploaderUrl and puts it in the database. This is similar to the fetching
of uploaderUrl when it doesn't exist done in #6919.
What is it?
Description of the changes in your PR
uploaderUrl
and saves it to the database into a helper class + method.saveUploaderUrlIfNeeded
method inQueueItemMenuUtil
when selectingShow Channel Details
in order to load theuploaderUrl
if it isn't available in the database.Before/After Screenshots/Screen Record
Android Emulator screen recording seems to be broken, I'll do my best to describe the before and after in text.
Show Channel Details
on a video that doesn't haveuploaderUrl
in the database, it will go to the channel fragment, but theuploaderUrl
will benull
, so it will cause a network error.Show Channel Details
on a video that doesn't haveuploaderUrl
in the database, it will fetch theuploaderUrl
and display a loading toast, then open the channel fragment.Fixes the following issue(s)
Did not find any issues that will be fixed by this PR.
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