The-Apiary / buzz

A podcast client with functionality inspired by Rdio
0 stars 2 forks source link

Redesign Queue to support reordering episodes #9

Closed everett1992 closed 10 years ago

everett1992 commented 10 years ago

Currently the queue really is a queue, you can't reorder things without removing and readding them in the right order. It is this because it was easy and efficient to build server-side. Each episode in the queue is a QueuedEpisode object.

To get the queue query for all of the users Queued Episodes in the order they were created. Adding and removing episodes is as easy as creating or deleting the queued episodes, and each action only needs to modify one queued episode.

Alternatives:

I think swapping episode_is's is the best options. Does anyone have input?

everett1992 commented 10 years ago

You can drag and drop items in the queue to reorder them. The drag and drop code is pretty ugly, I need to disable drop targets that won't change the order of the queue.

I went with a weird SQL implementation, episodes are assigned an index between the indexi of the next and previous index. if two episodes have indexi that are within one integer of each other all indexi are recalculated. I'm not handling this on the client yet so heavy queue use without reloads can lead to unexpected behavior. Working on that next.