Find the answer to your Linux question:
Results 1 to 4 of 4
In my previous linux install, mpc command "playlist" would list the songs with an absolute track number (by "absolute" I mean the track number used by the program itself, irrespective ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Apr 2007
    Posts
    214

    Question [SOLVED] How to get the playlist with native mpc/mpd absolute track number?


    In my previous linux install, mpc command "playlist" would list the songs with an absolute track number (by "absolute" I mean the track number used by the program itself, irrespective of what is the album track number attributed by a metatag in the file or something like that), but now all I get is the list with the titles.

    I tried adding "-f [%track% %artist% %title%]" to specify the format, but the "%track%" refers to the track relative to an album or something else, not the number I got to point to mpc to play an specific song, which is only shown for the song currently being played.

    I guess I could make some wrap script that would add numbers to the playlist, but there must be a more proper way to do that. Does mpc has a configuration file, like mpd does? Or would that be set on mpd configuration file? I couldn't find where would it be, I'm actually using the same configuration file I had in my previous linux install.


    The versions of mpc and mpd differ from the previous install. Mpd was "0.13.2-3lenny1", now it is "0.15.8-1+b1", and mpc was "0.12.1-1", now it is "0.19-2". I guess it must be some configuration thing, though.

  2. #2
    Linux Newbie
    Join Date
    Apr 2007
    Posts
    214
    Not exactly solved, but...

    If I use:

    mpc playlist -f " [%id%) %artist% - %title%]"

    I get a list with numbers. I just guessed this %id%, it is not on the manual, even though it exist... even though its wrong. It starts from zero, not from one, so one must add 1 to the given id in order to play a certain song.

    Now I'm starting to suspect it's a bug, rather than some configuration issue.

  3. #3
    Just Joined!
    Join Date
    Jul 2010
    Posts
    1
    Hi!

    Thanks dude! After a package upgrade I've also noticed the absence of position numbers for the mpc playlist command, but reading your post I've find the solution, of course like you, guessing!

    try mpc playlist -f " [%position%) %artist% - %title%]"

    Thanks again!

    bye

  4. #4
    Linux Newbie
    Join Date
    Apr 2007
    Posts
    214
    Thanks! Glad I've helped.

    Now I can remove my "ugly fix" from my mpc script, thanks to you:

    Code:
    [...]
    
    mpc playlist -f "[%id%) %artist% - %title% ( %file% )]" |egrep --color -ir $string
    
    echo
    echo Give the track number, or press enter to try another search string. 
    read which 
    case "$which" in 
    "" )
    clear
    mpcf
    ;;
    esac
    mpc play $(($which +1)) #ugly fix
    I'd never guess that "position" would be the answer, I'd think it's related with the "instant position" of the track, how many minutes and seconds have past since the beginning. I would only find that if I was just playing with guesses, trying to find what to use to get that "other" position, if I could only realize that it is instead the track number...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •