calzoneman / sync

Node.JS Server and JavaScript/HTML Client for synchronizing online media
Other
1.47k stars 231 forks source link

Feature Request RFC: Mid playlist queuing. #611

Open Xaekai opened 8 years ago

Xaekai commented 8 years ago

I raise this issue on behalf of v4c and have no vested interest in it's implementation.

They wish to be able to use an integer for pos in queue frames. Perhaps using -1 for what used to be end

It seems be an esoteric request, but one that could be implemented with only minor changes to the client, ie change references to end to -1 if we just want to add backend support while ignoring it. No changes needed to permissions, basically the current add next permission would allow for anything non-end

My vote is "don't care, it doesn't seem like it would add too much to code maintenance hassle"

There is also the issue of channel script/bot breakage, but I'm willing to PR a fix for that upstream to Nuke asap upon implementation and field all queries about script troubles in IRC.

calzoneman commented 8 years ago

So are they watching this issue or?

I'm not really sure what the ask is, is it to be able to queue after an arbitrary item in the playlist? I'm not really sure what the use case is for that.

Xaekai commented 8 years ago

Yeah, they are.

And yes, that is the gist of it.

calzoneman commented 8 years ago

I need to understand what possible purpose this would serve before I can comment on the technical aspect.

nonfictiongames commented 8 years ago

calzoneman, the use case for this would be in the event that a room's rules stipulate where specific or certain videos or types of videos are allowed to be added into the playlist.

The functionality would be taken advantage of in the form of client-side methods (buttons, makeshift chat functions, bot commands, etc.) of inserting said videos at arbitrary positions.

For example, in our room (which is centered around video game content), we only allow videos with actual video game content to be queued next in the list, as a sort of incentive to keep things on topic. We restrict moderators from bumping non-"video game related" videos past position 5 in the list.

I can imagine a button which emits a request to add a link at pos: 5, but currently that is impossible due to there being nothing in the software capable of parsing that request.

Esoteric as it may be, this would help us out a lot and prevent the hassle that comes along with not being able to do this, such as: unnecessary or otherwise extra client-side commands in chat, accidental bumps to 1, and just general quality of life enhancement. Other rooms may also end up finding ways of taking advantage of this new functionality, of which I'm failing to think of at the moment.

calzoneman commented 8 years ago

As a clarification: CyTube doesn't have the concept of playlist "position" or the numeric index of a video in the playlist. The playlist is an ordered list of items each of which has an ID, and all manipulations are done relative to these IDs. For example, instead of "move the video at position 3 to position 5", there is "move the video with ID foo after the video with ID bar". This is because using positions always ends in tears due to clients and the server getting out of sync when events are delayed or processed out of order.

I'm willing to scope adding after an arbitrary ID into the planned refactoring of the playlist code, it should work pretty similarly to next/end except there are a few edge cases (what happens if the video you want to add after is deleted before you finish queueing?). However, I would not add the ability to queue to a certain numeric position for the reasons stated above.

Personally, your use case on top of this behavior sounds like a complicated pain in the ass to maintain, but hey I'm not the one maintaining it.

nonfictiongames commented 8 years ago

It would be very much appreciated. We've already talked it over and I think we have a pretty decent idea of how we can make that work on our end, given that we're able to place videos after an arbitrary ID. Thank you for the quick response!