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

Only show "Enqueue next" when in the middle of the queue #8883

Merged
merged 1 commit into from
Dec 4, 2022

Conversation

Douile
Copy link
Contributor

@Douile Douile commented Aug 25, 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

Add a check that the queue position is not the last in the queue before
showing "Enqueue next".

Previously the "Enqueue next" action would always be shown if the queue
length was greater than one, this meant even if you were at the end of
the queue (when "Enqueue" would have the same effect as "Enqueue next")
the action would still be shown.

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

@sonarcloud
Copy link

sonarcloud bot commented Aug 25, 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

@killerrook
Copy link

killerrook commented Oct 10, 2022

Well it will degrade newpipe experience for some users as when you have a long queue and you want to play something after current video is played ensue next is used else for making a long queue you should use 'enqueue' button

@TobiGr TobiGr added the player Issues related to any player (main, popup and background) label Oct 10, 2022
@Douile
Copy link
Contributor Author

Douile commented Oct 10, 2022

I'm confused how this will degrade experience, it will only hide the enqueue next button when it has the same effect as the enqueue button: when you are in watching the last video in the queue

@killerrook

This comment was marked as off-topic.

@Douile
Copy link
Contributor Author

Douile commented Oct 11, 2022

This patch only hides the enqueue next button when you are currently playing video E, therefore whichever button you press there is only 1 place for F to go: the sixth position.

Comment on lines 259 to 260
final int size = holder.getQueueSize();
if (size > 1 && holder.getQueuePosition() < size - 1) {
Copy link
Member

Choose a reason for hiding this comment

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

I think you don't need the size > 1 condition. If size <= 1, then size - 1 <= 0, and since queuePosition is always >= 0, it is never < size - 1 <= 0.

Suggested change
final int size = holder.getQueueSize();
if (size > 1 && holder.getQueuePosition() < size - 1) {
if (holder.getQueuePosition() < holder.getQueueSize() - 1) {

Add a check that the queue position is not the last in the queue before
showing "Enqueue next".

Previously the "Enqueue next" action would always be shown if the queue
length was greater than one, this meant even if you were at the end of
the queue (when "Enqueue" would have the same effect as "Enqueue next")
the action would still be shown.
Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

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

Thank you! I tested and it works well

@sonarcloud
Copy link

sonarcloud bot commented Dec 4, 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

@Stypox Stypox merged commit 281ac13 into TeamNewPipe:dev Dec 4, 2022
@Stypox Stypox mentioned this pull request Jan 22, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
player Issues related to any player (main, popup and background)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants