Skip to content

Add PlayQueueItem equals and hashCode#12347

Merged
Isira-Seneviratne merged 5 commits intoTeamNewPipe:refactorfrom
Isira-Seneviratne:PlayQueueItem-equals
Jul 9, 2025
Merged

Add PlayQueueItem equals and hashCode#12347
Isira-Seneviratne merged 5 commits intoTeamNewPipe:refactorfrom
Isira-Seneviratne:PlayQueueItem-equals

Conversation

@Isira-Seneviratne
Copy link
Copy Markdown
Member

@Isira-Seneviratne Isira-Seneviratne commented Jun 11, 2025

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

  • Reduce some lines of code by implementing the equals and hashCode contracts for PlayQueue and PlayQueueItem.
  • Convert the play queue classes to Kotlin.

Fixes the following issue(s)

  • Fixes #

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

@github-actions github-actions Bot added the size/medium PRs with less than 250 changed lines label Jun 11, 2025
@Isira-Seneviratne Isira-Seneviratne force-pushed the PlayQueueItem-equals branch 2 times, most recently from 741788a to 4dbc7a5 Compare June 11, 2025 02:03
@sonarqubecloud
Copy link
Copy Markdown

@ShareASmile ShareASmile added the code quality Improvements to the codebase to improve the code quality label Jun 12, 2025
Copy link
Copy Markdown
Contributor

@HatakeKakashri HatakeKakashri left a comment

Choose a reason for hiding this comment

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

Thanks for this. I would prefer the Queue classes to be converted to Kotlin in the same PR. WDYT

if (playQueue == null) {
playQueue = new SinglePlayQueue(result);
}
if (stack.isEmpty() || !stack.peek().getPlayQueue()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should be possible to use == operator here now.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That's only possible for Kotlin.

@github-actions github-actions Bot added size/giant PRs with more than 750 changed lines and removed size/medium PRs with less than 250 changed lines labels Jul 4, 2025
@ShareASmile ShareASmile added the ready for review Most of the work is done, PR is now ready for a review label Jul 4, 2025
Copy link
Copy Markdown
Contributor

@HatakeKakashri HatakeKakashri left a comment

Choose a reason for hiding this comment

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

Thanks 🎉

@Isira-Seneviratne Isira-Seneviratne merged commit 52ff052 into TeamNewPipe:refactor Jul 9, 2025
5 checks passed
@Isira-Seneviratne Isira-Seneviratne deleted the PlayQueueItem-equals branch July 9, 2025 20:48
@ShareASmile ShareASmile added rewrite Issues and PRs related to rewrite and removed ready for review Most of the work is done, PR is now ready for a review labels Jul 10, 2025
@github-project-automation github-project-automation Bot moved this to In Progress in Rewrite Jul 10, 2025
@ShareASmile ShareASmile moved this from In Progress to Done in Rewrite Jul 10, 2025
TobiGr added a commit to TobiGr/NewPipe that referenced this pull request Feb 6, 2026
@TobiGr TobiGr mentioned this pull request Feb 6, 2026
3 tasks
&& newQueue.size() == 1 && newQueue.getItem() != null
&& playQueue != null && playQueue.size() == 1 && playQueue.getItem() != null
&& newQueue.getItem().getUrl().equals(playQueue.getItem().getUrl())
&& newQueue.getItem().getRecoveryPosition() != PlayQueueItem.RECOVERY_UNSET) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I just ran into issues with this. Please ensure to keep constants while converting to kotlin in the futur. I reverted the removal of the RECOVERY_UNSET constant in #13202

whistlingwoods pushed a commit to whistlingwoods/FoxPipe that referenced this pull request Feb 7, 2026
whistlingwoods pushed a commit to whistlingwoods/FoxPipe that referenced this pull request Feb 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code quality Improvements to the codebase to improve the code quality rewrite Issues and PRs related to rewrite size/giant PRs with more than 750 changed lines

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants