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

feat: support for downloading whole playlist at once #5525

Merged
merged 1 commit into from
Jan 22, 2024

Conversation

Bnyro
Copy link
Member

@Bnyro Bnyro commented Jan 21, 2024

closes #3080

disclaimer: only tested for very small playlists so far

@RafaelsRamos if you have time, I'd appreciate a quick review!

Copy link
Contributor

@RafaelsRamos RafaelsRamos left a comment

Choose a reason for hiding this comment

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

@RafaelsRamos if you have time, I'd appreciate a quick review!

Sure, it is always a pleasure to help!

First of all, congratulations, great work 💪 🚀

That being said, with the introduction of this incredible feature, it may be worth revisiting the Downloads screen.

There are a few points I think we should address in future tickets:

  1. Adding a multiple downloads removal feature, since at the moment, it takes too much time to remove large amounts of downloads one by one;
  2. The downloads recycler view has flaky behaviour when removing items from it (video below - 1st video);
  3. When selecting to watch a download that has yet to start being downloaded (It frequently happens when we're trying to download many videos), we get into a state where the video will never play (sample below - 2nd video). I don't think this needs to be addressed ASAP, but I think at some point, we could prevent the user from advancing + show a toast with some message 🤔 ;
  4. Lastly, with this new feature, we need to reload the downloads page a few times until we can see all the items that will be downloaded. This issue can be mitigated by adding that "Repository" layer we discussed the other day. With this layer, the DownloadsFragment can observe changes on a LiveData object that resides in the repository and is updated when new entries are added to the local database (also, this issue is not crucial, but it might be worth looking at in the future);

Of course, I would be very happy to address some of the issues pointed out above if you agree 👍

flaky_rv_behaviour.mp4
watching_video_with_unstarted_download.mp4

val availableLanguages = LocaleHelper.getAvailableLocales()

binding.videoSpinner.items = listOf(getString(R.string.no_video)) + possibleVideoQualities
binding.audioSpinner.items = listOf(getString(R.string.no_audio)) + possibleAudioQualities
Copy link
Contributor

Choose a reason for hiding this comment

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

Wanted to bring up the debate on having different default values. Additionally, do you think it may be worth saving on shared prefs the previously used settings in the future? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, in the future. We already do this for the normal download dialog, but I wanted to keep this PR simple and basic for now.

Copy link
Member

@FireMasterK FireMasterK left a comment

Choose a reason for hiding this comment

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

I tried reviewing with my limited Android knowledge 😅

}

companion object {
private const val ENQUEUE_PROGRESS_NOTIFICATION_ID = 3
Copy link
Member

Choose a reason for hiding this comment

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

Rather than having this here as a magic number, would it make sense to create an enum somewhere else along with other notification IDs? It's difficult to understand why 3 is used otherwise. (I'm guessing 1 and 2 are used elsewhere in the app)

This could be another PR perhaps.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, we should probably do thay in an other PR. 1 and 2 are used for the player and the normal download notification.

@Bnyro Bnyro merged commit 1387eba into libre-tube:master Jan 22, 2024
2 of 3 checks passed
@Bnyro Bnyro deleted the download-playlists branch January 22, 2024 13:00
@Bnyro
Copy link
Member Author

Bnyro commented Jan 22, 2024

@RafaelsRamos

1. Adding a multiple downloads removal feature, since at the moment, it takes too much time to remove large amounts of downloads one by one;

I had the same thought and opened #5526 yesterday. However, being able to select which ones to delete would be nice too. It's up to what you think works best and is doable to implement 👍

2. The downloads recycler view has flaky behaviour when removing items from it (video below - 1st video);

Yes, I noticed that too, but I guess it's rather low priority for now.

3. When selecting to watch a download that has yet to start being downloaded (It frequently happens when we're trying to download many videos), we get into a state where the video will never play (sample below - 2nd video). I don't think this needs to be addressed ASAP, but I think at some point, we could prevent the user from advancing + show a toast with some message 🤔 ;

Yes, that's certainly a good idea (but as you said, not that important for now, but still reasonable).

4. Lastly, with this new feature, we need to reload the downloads page a few times until we can see all the items that will be downloaded. This issue can be mitigated by adding that "Repository" layer we discussed the other day. With this layer, the DownloadsFragment can observe changes on a LiveData object that resides in the repository and is updated when new entries are added to the local database (also, this issue is not crucial, but it might be worth looking at in the future);

I agree with you on that, in this specific case it would make sense to use a repository and live data to make everything more responsive. Feel free to look into that if you want to, I'd appreciate it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Download playlist and list whole playlist under download
3 participants