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

Add button to add a remote playlist to a local one #7355

Merged
merged 1 commit into from
May 12, 2022

Conversation

petlyh
Copy link
Contributor

@petlyh petlyh commented Nov 3, 2021

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

This PR adds an option to the menu for remote/non-local playlists
that appends the playlist items to a local playlist.

NOTE FOR BLOGPOST WRITERS: make sure to specify that only the part of the playlist that has already been loaded (in case of YT, the first 100 videos) will be actually added to the chosen local playlist; the other videos won't be fetched. See #7355 (comment).

Before/After Screenshots/Screen Record

  • Before:

  • After:
video.mp4

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

@triallax triallax added the feature request Issue is related to a feature in the app label Nov 5, 2021
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.

Code looks good (I didn't test). The only problem is the one I pointed out below. Maybe this could be merged anyway? The problem of not loading the whole playlist when we should is not only a problem of this PR but of some parts of the app in general, so I think merging this PR anyway is not really introducing a new problem.

Comment on lines +276 to +247
getPlayQueue()
.getStreams()
Copy link
Member

Choose a reason for hiding this comment

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

The issue with this is that if the playlist was not completely loaded, only the first few items are added to the other playlist, not all of them. E.g. my YouTube music playlist has ~200 videos, but YouTube loads 100 items at once, so in order to add the whole playlist to another playlist with this option I'd first have to scroll down to the bottom so that I'm sure it was loaded completely.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had tried having it load the entire playlist automatically when selecting the menu option. However, the lack of a loading indicator when loading large playlists may be a problem (see video). What are your thoughts?

video.mp4

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure. Somebody will definitely find this useful, but I wouldn't introduce full playlist loading in this PR since it introduces some things that need to be resolved, and I would address them in a separate PR. You'd be welcome to create such a PR :-)

  • a loading indicator should be shown somewhere, as you said
  • what happens if the playlist length is infinite (and we could not know that it is infinite)? Infinite playlists are e.g. YouTube mixes. We have to discuss this.

What do you think @petlyh @litetex @TobiGr @TiA4f8R ?

@SameenAhnaf

This comment has been minimized.

@Stypox
Copy link
Member

Stypox commented Nov 21, 2021

@SameenAhnaf sorry but no, that's a strange solution. Bookmarking should be easily available through the toolbar button like it is now (not hidden under two clicks). And putting "Add to playlist" to the toolbar hidden items is a perfectly normal and good practice thing to do in Android. Also, this "Add to playlist" button does not need to be that fast-accessible, hiding it under the three dot menu suffices.
Also, please make the images smaller when you post a comment. See how I edited your comment for an example. You can add a GitHub saved reply for this if you (like me) don't remember the syntax sometimes.

@SameenAhnaf

This comment was marked as spam.

@Stypox
Copy link
Member

Stypox commented Mar 17, 2022

I think this PR does a different thing, so I'd keep it. And I don't understand your sencond paragraph 😅

@opusforlife2
Copy link
Collaborator

This also allows saving a remote playlist locally.

@Stypox This is the line from the OP of #8008 that is being referred. The question is: since what this PR wishes to achieve can be done through #8008 (although in a slightly roundabout way), is this PR needed anymore?

@MD77MD
Copy link

MD77MD commented Apr 27, 2022

This also allows saving a remote playlist locally.

@Stypox This is the line from the OP of #8008 that is being referred. The question is: since what this PR wishes to achieve can be done through #8008 (although in a slightly roundabout way), is this PR needed anymore

Yes... because it's not the same

@Stypox
Copy link
Member

Stypox commented May 2, 2022

@opusforlife2 yes, the roundabout way is strange, this PR is the proper way (and it is also so simple). Also, the roundabout way existed also before #8008, as I already said when reviewing the blogpost ;-)

@petlyh I would merge this, sorry for the delay. Could you rebase? Thanks :-)

@petlyh
Copy link
Contributor Author

petlyh commented May 10, 2022

Could you rebase? Thanks :-)

@Stypox Done :-)

@sonarcloud
Copy link

sonarcloud bot commented May 10, 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

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.

Looks good to me, thank you! :-)
I tested a couple of situations (youtube normal, youtube learning, soundcloud, ...) on API 31 emulated and it works as expected

If you want to introduce infinite loading, a new PR would be well accepted ;-)

@Stypox Stypox merged commit b4615f7 into TeamNewPipe:dev May 12, 2022
@Stypox Stypox changed the title Add a "Add to playlist" item to the remote playlist menu Add button to add a remote playlist to a local one May 12, 2022
@Stypox Stypox mentioned this pull request Jun 24, 2022
3 tasks
@triallax triallax mentioned this pull request Jul 25, 2022
5 tasks
@Fs00 Fs00 mentioned this pull request Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issue is related to a feature in the app
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a Youtube playlist content inside a user playlist
6 participants