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

Watch Later button addition #13

Open
Hannah-GBS opened this issue Dec 11, 2020 · 3 comments
Open

Watch Later button addition #13

Hannah-GBS opened this issue Dec 11, 2020 · 3 comments

Comments

@Hannah-GBS
Copy link

I know this hasn't seen an update in a while but I figure, don't ask don't get.

Would it be at all possible with how the RT site works to add the "add to Watch Later" button that is found on the built-in site pages?

@Countryen
Copy link

Hey @loldudester, as far as I know the project is only maintained by @patrickmaher without further development.
That beeing said, there might be forks that already extend the functionality of this tool - maybe search will help you?

Other than that, what exactly do you mean be "add the 'add to Watch Later' button"?
Where do you want that button?

Do you mean on the "RECENTLY ADDED" page?
That should be possible, since everything is API controlled, have a look at the source code here.

You just need to add the button with a new API-call to add the video (by UUID) to the list when the videos are retrieved, for example:

So yes, it should be possible :)


Also, I think there is an even easier way: The UUID of each episode/show/channel is already in the HTML as data-attributes (how nice).
Example:

<div class="col s12 m4 l3" style="margin-left: 0px;" 
  **data-episode-id="e972f553-e310-4b4f-8620-f300d0e05186"** 
  data-channel-id="92b6bb21-91d2-4b1b-bf95-3268fa0d9939" 
  data-series-id="8ce7f46c-2b6a-4265-b704-4f863171ed83">
    <div class="episode-card">...</div>
</div>

This way you could just add a little script that reads the data-episode-id value and adds the button.
You can even add a button to the context menu this way.

@patrickmaher
Copy link
Owner

@loldudester, I am sorry to say that I don't have time to add any new features at the moment. I am still committed to maintaining the Recently Added page if/when it breaks.

Your feature request is a good one and it is something that I wanted to add. In fact I did look into this in the past and figured out it is possible much in the way that @Countryen has proposed. I just didn't have time to build a reliable UI to handle this.

If someone wants to go ahead and add this feature please feel free to do so. I'll provide some information on what I wanted from the UI for this feature. I wanted a button that has reliable feedback. The button should update to indicate that the item was added to the watch later list only if the server responds that it has successfully adds the item to the list. If the item is already in the watch later list that should be indicated on the Recently Added page and their should be an option to remove it from the list (again confirming success). Identifying which videos are already in the watch later list requires some planning. We don't want to hit the API server over and over again checking for each video. As @Countryen pointed out, I put data-attributes for each episode in the HTML which could help to mark videos that are already in the watch later list.

I'll leave this issue open in case someone wants to tackle it.

@Countryen
Copy link

Identifying which videos are already in the watch later list requires some planning. We don't want to hit the API server over and over again checking for each video

Should not be a problem as the API-call to retrieve the "my watchlist" gives back the complete list.

https://lists.roosterteeth.com/api/v2/my/playlists/watch_later/items/
Example:

{"data":[
{"id":"3911043","type":"playlist_item","attributes":{"content_uuid":"c411fcbc-3a05-47df-aa58-5ded030e9a7b","content_type":"episode","position":1,"created_at":"2019-07-11T23:30:00.678Z","updated_at":"2019-07-11T23:30:00.678Z"}},
{"id":"3911044","type":"playlist_item","attributes":{"content_uuid":"68ba1112-bf45-4ad5-98cd-e9dbd91dcd38","content_type":"episode","position":2,"created_at":"2019-07-11T23:30:00.678Z","updated_at":"2019-07-11T23:30:00.678Z"}},
...
],"meta":{"page":{"total":1}},"links":{"self":"https://lists.roosterteeth.com/api/v2/my/playlists/watch_later/items?page=1&per_page=20"}}`

This list could be cached in localstorage and (manually/automatically) refreshed or retrieved on page-load (shouldn't take long).

@patrickmaher How would you like the caching to look like or would you prefer to load the complete list on page-load, maybe only cached for the active session (until the window is closed)?

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

No branches or pull requests

3 participants