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

Stable insertion ordering #6

Open
Kilenaitor opened this issue Jul 24, 2020 · 0 comments
Open

Stable insertion ordering #6

Kilenaitor opened this issue Jul 24, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@Kilenaitor
Copy link
Contributor

Kilenaitor commented Jul 24, 2020

Right now, when the script runs, any discovered unprocessed entries from the wiki will be inserted at position 0, pushing the rest of the playlist down below it. This is with the intent of keeping the newest music at the top of the playlist.

However, these links don't all become available at the same time. So, instead, it's a good idea to keep track of what position the songs should be in the playlist. Should be pretty easy to figure out, but might be more computationally-expensive.

Rough calculation should be:

offset = 0
for each release in front of the one to add:
offset += release * tracks on release

then use that offset as the 'position' argument for insertions.

OTHER option that's potentially much cheaper... is if we detect a new release in the middle... just clear out the playlist and rebuild it lol.

This is potentially more disruptive, though.

@Kilenaitor Kilenaitor added the enhancement New feature or request label Jul 24, 2020
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

1 participant