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

[Feature Request]: User created playlist #590

Closed
2 tasks done
greg321321 opened this issue Nov 11, 2023 · 20 comments
Closed
2 tasks done

[Feature Request]: User created playlist #590

greg321321 opened this issue Nov 11, 2023 · 20 comments
Labels
enhancement New feature or request

Comments

@greg321321
Copy link
Contributor

I've read the documentation

Your Feature Request

I would like to build a Watch Offline feature into this project.

Use Case: When at a location where there is no internet connection, I would like to view videos on my PED (Personal Electronic Device).

User Stories:

  1. As a user, I want to create a custom playlist. (existing roadmap feature)
  2. As a user, I want to toggle a custom playlist for Watch Offline.
  3. As a user, when I am at a location where there is no internet connection, I want to view my 'Watch Offline custom playlist' videos.

I believe all this work can be done simply using web caching. Let me know if you think this is a good idea. I can build the feature with your direction and knock out one or two of your roadmap features/bugs in the process. I am a software developer familiar with web technologies/gitlab.

Your help is needed!

  • Yes I will work on this in the next few days or weeks.
@bbilly1
Copy link
Member

bbilly1 commented Nov 11, 2023

Well, this is already an offline application. TA doesn't need internet connection to work, after you have downloaded and indexed your videos obviously. Should also be portable, like move a portion of TA to you laptop temporarily, all persistent data is in the volume, or if you know you'll be offline later, sync your data first, then you can use TA offline perfectly well. Just saying that you can do that already.

To the rest, obviously, please go ahead, any of the documented bug reports or feature requests are ready to be taken on by you.

@bbilly1 bbilly1 added the question Further information is requested label Nov 11, 2023
@greg321321
Copy link
Contributor Author

ok I think I will start on the playlist idea first (existing roadmap feature). The offline scenario is for an Android phone. I goto the gym and they don't have good WiFi, I don't have an unlimited cell data plan, but would still like to watch videos from my phone.

@bbilly1
Copy link
Member

bbilly1 commented Nov 12, 2023

Ah, I see, you mean offline from the TA server and not from the internet. Honestly that sounds like out of scope for this project, I don't see how this could be done with caching alone, as the interface constantly interacts with the backend.

Maybe some sort of static site generator would be a better approach? Or some sort of export script that can just get the video files you want and makes a copy to your phone? So you can use the phones built in media player?

@greg321321
Copy link
Contributor Author

thanks you've given me some good ideas to refine the use case. Maybe something simple like 'download playlist'. In the meantime, I played around with the dev code and propose this menu organization for custom playlists:
Screenshot from 2023-11-12 09-24-52

@greg321321
Copy link
Contributor Author

simple ui for now to create and remove playlists
Screenshot from 2023-11-12 15-45-03

@greg321321
Copy link
Contributor Author

simple menu to add video to a playlist
Screenshot from 2023-11-12 23-40-52

@pairofcrocs
Copy link
Contributor

Looks great!

A lot of people have been asking for this feature, and will make a great addition :)

@bbilly1
Copy link
Member

bbilly1 commented Nov 15, 2023

Nice, some great progress here!

Not sure how well this is going to work once you have a dozen plus playlists? That will mess up the layout there. Maybe the controls for adding a video to a playlist would be better
suited on the video detail page? That already has the playlist navigation there too...

Edit:
I took the liberty to rename the issue. Feel free to open a PR, you can mark it as draft until you are ready.

@bbilly1 bbilly1 changed the title [Feature Request]: Watch Offline [Feature Request]: User created playlist Nov 15, 2023
@bbilly1 bbilly1 added enhancement New feature or request and removed question Further information is requested labels Nov 15, 2023
@greg321321
Copy link
Contributor Author

take a look at how youtube does this. It is similar to this approach. I can add scrollbar to drawer menu to limit impact on layout. If it turns out the drawer is a problematic, I can switch it to a popup centered around the tile, but I imagine that will come with it's own complexity to solve. I'm trying to limit this feature to 3 days or less (24 hrs or less) so the idea here is to get some basic features working so we can take a look at it on the testing branch.

@greg321321
Copy link
Contributor Author

playlist controls
Screenshot from 2023-11-16 06-46-02

@greg321321
Copy link
Contributor Author

I sent a preview pull request for this feature. I didn't see an option to associate the pull request to this ticket. Can you tell me how to do that?

@bbilly1
Copy link
Member

bbilly1 commented Dec 1, 2023

Are you still working on this? Ideally this should be tied together with #609, to make playlists extendible by type. I'd suggest to set a playlist_type field so this can be filtered similarly how the channel subpages are implemented.

So playlist_type could be any of regular (default), custom, album and whatever we come up with later down the road.

@greg321321
Copy link
Contributor Author

yes. playlist_type makes sense seeing the other feature request. I chose an is_custom boolean field, but I can refactor into the playlist_type. One issue that came up when inspecting the code is how we want to handle the existing playlists. I'd like to create a routine during the upgrade process that will add this field if it does not exist. Otherwise the elastic search queries and view logic contain many conditional statements.

@bbilly1
Copy link
Member

bbilly1 commented Dec 1, 2023

For the migration, you can take inspiration from how this has been handled before in similar cases, for example when we introduced auto start in v0.3.6:
https://github.com/tubearchivist/tubearchivist/blob/v0.3.6/tubearchivist/config/management/commands/ta_startup.py#L197-L204

Basically create a query similar to that, but if must not exist field playlist_type, then set it to string 'regular' with the script. Then that command will always run at start up and will set the default playlist_type for all playlists that does not have the field set and won't do anything if a document has that field set.

With that approach you don't have to worry about any temporary logic within the application. And with the must not exist logic, you don't need to worry to overwrite legitimate custom playlists as these will have the field set. I hope that makes sense?

That has been the most robust approach, at least from what I have come up with so far. Plus it's easy to remove after a few releases and we don't clutter up the code base with all these temporary migration logic.

@greg321321
Copy link
Contributor Author

agree will do. this will need a good testcase

@keyvaann
Copy link

keyvaann commented Dec 2, 2023

I prefer to use Jellyfin to watch the TA videos. In there I can download the videos before going out to my phone or ask it to transcode it to a lower bitrate if I want to watch it with limited data plan.

@greg321321
Copy link
Contributor Author

I prefer to use Jellyfin to watch the TA videos. In there I can download the videos before going out to my phone or ask it to transcode it to a lower bitrate if I want to watch it with limited data plan.

Thanks K1 I will have to install Jellyfin and take a look. I recall looking at their documentation and not seeing what I wanted. I like watching the youtube content from a list. So the concept I am looking for is: add/remove content from a list. Sync a device (once) with a list. Device auto downloads the list, device auto updates the list. I think this can be done with a combination of this feature, plus a real small new feature that provides a link to the 'podcast' format of the list. I think there are a lot of apps out there that understand the podcast format. Podcasts genre is update frequently (weekly basis for example), so I imagine the app developers have thought of this and have an offline solution to my use case. I'll have to see if there is a simple solution out there.

@greg321321
Copy link
Contributor Author

code update complete. Pull request issued at: #620

@greg321321
Copy link
Contributor Author

requested additional permissions from admin so I can resolve merge conflict on testing branch.

@bbilly1 bbilly1 added the pending-release Fixed and pending release label Mar 11, 2024
@bbilly1 bbilly1 removed the pending-release Fixed and pending release label Apr 10, 2024
@bbilly1
Copy link
Member

bbilly1 commented Apr 10, 2024

implemented and merged with v0.4.7, shutout to @greg321321

@bbilly1 bbilly1 closed this as completed Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants