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

Better priority logic #594

Open
roizcorp opened this issue Jun 29, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@roizcorp
Copy link

commented Jun 29, 2019

Feature request

Moving away from gui mpd clients into using mpc, I started to get the potential of the priority feature. normally I would use MPD playing the entire music dir in the queue (randomized), while listening to music I pick up songs along the way to listen later on thus the priority feature :).

Problem is that you need to specify the "degree" of priority for each song you prioritize. In most cases the first song I prioritize - I would like to hear right after the current song, the second song would play after that and so on...but the absolute number I have to provide with each prio command limits me as I need to set the first song with the highest priority number w/o knowing how many I'm going to prioritize.

Currently I made a workaround which I believe, makes better use (and would like to suggest it), currently with every song I want to prioritize i'm doing the following:

  1. list the queue for prioritzed songs, if none then provide prio 1 <song_pos>
  2. in case there is prioritized song, I "push" it forward by increasing the current priority by 1 i.e. prio <old_prio +1> <song_pos>, then provide the new song I want to prioritize with prio 1 (because it is the lowest)
  3. on the n song I would like to add, I will pull the list of prioritized songs mpc -f "[%prio%]_[%position%]" playlist | grep -E '^[1-9]_'
  4. sort the list numerically, reversed
  5. increase all songs' priority by 1, (loop, one song at a time)
  6. finally, provide the n song, priority 1 prio 1 <new_song_pos>
@MaxKellermann

This comment has been minimized.

Copy link
Member

commented Jul 2, 2019

And what is your feature request?

@roizcorp

This comment has been minimized.

Copy link
Author

commented Jul 4, 2019

To change the logic of priority feature to become a FIFO array basically,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.