Album booklet in GMPC (or other MPD client) ?

Gnome Music Player Client - Support forum for the oldest GTK+ based Client.
Website: http://gmpclient.org/

Album booklet in GMPC (or other MPD client) ?

Postby nbpf » June 17th, 2014, 1:21 pm

Many companies (e.g. eclassical.com, highresaudio.com) offer downloads of digital booklets, usually as .PDF files. Is there a GMPC plugin which allows one to access booklets (in much the same way as cover, lyrics, etc. can be accessed) and open them with a user selectable PDF viewer ? Thanks, nbpf.
nbpf
 
Posts: 56
Joined: June 17th, 2014, 6:45 am

Re: Album booklet in GMPC (or other MPD client) ?

Postby Rasi » September 21st, 2014, 2:25 pm

no... if you save them with a strict naming scheme (e.g. artist-album.pdf) you can easily create script that will open the file in pdf viewer...

example:

Code: Select all
#!/bin/bash
pdfpath=/path/to/your/pdffiles
viewer=evince

$viewer "$pdfpath"/"$(mpc current --format '%artist%-%album%')".pdf


make it executable and assign a hotkey to it.


or if you store those in your album folder:

Code: Select all
pdfpath=/path/to/music_root #as defined in mpd.conf
viewer=evince

$viewer "$pdfpath"/"$(dirname "$(mpc current --format '%file%')")"/"$(mpc current --format '%artist%-%album%')".pdf



I hope there is no typo in that last code block :)
Rasi
Forum team
 
Posts: 141
Joined: January 16th, 2013, 7:29 pm

Re: Album booklet in GMPC (or other MPD client) ?

Postby nbpf » February 1st, 2015, 3:46 pm

Rasi wrote:no... if you save them with a strict naming scheme (e.g. artist-album.pdf) you can easily create script that will open the file in pdf viewer...

example:

Code: Select all
#!/bin/bash
pdfpath=/path/to/your/pdffiles
viewer=evince

$viewer "$pdfpath"/"$(mpc current --format '%artist%-%album%')".pdf


make it executable and assign a hotkey to it.


or if you store those in your album folder:

Code: Select all
pdfpath=/path/to/music_root #as defined in mpd.conf
viewer=evince

$viewer "$pdfpath"/"$(dirname "$(mpc current --format '%file%')")"/"$(mpc current --format '%artist%-%album%')".pdf



I hope there is no typo in that last code block :)

Thanks Rasi but this seems to be a solution for a slightly different problem from the one I actually have: I would like to display the booklet associated to a given album on the device on which the MPD client is running. This is usually not the device on which the MPD server is running and where the .pdf files are stored. I can have an apache2 server running on the same machine which is running the MPD server (this is in fact already in place because my wife's iOS-based MPD clients require it for cover art). But as a minimum I have to use the output of

$(dirname "$(mpc current --format '%file%')")"/"$(mpc current --format '%artist%-%album%')

in a request to the webserver. Any idea how to do this ? Best, nbpf
nbpf
 
Posts: 56
Joined: June 17th, 2014, 6:45 am

Re: Album booklet in GMPC (or other MPD client) ?

Postby nbpf » February 1st, 2015, 6:32 pm

On a Unix system running GMPC, this seems to work quite nicely:

Code: Select all
#!/bin/sh                                                                                                                             
                                                                                                                                     
server="fitpc3"                                                                                                                       
viewer="xpdf -fullscreen"                                                                                                             
tmpfile="/home/nicola/tmp/booklet.pdf"                                                                                               
                                                                                                                                     
if wget -q "http://$server/music/$(dirname "$(mpc -h $server current --format '%file%')")/booklet.pdf" -O $tmpfile;                   
  then $viewer $tmpfile; rm $tmpfile;                                                                                                 
  else echo "booklet not found"                                                                                                       
fi


Best,
nbpf
nbpf
 
Posts: 56
Joined: June 17th, 2014, 6:45 am


Return to GMPC

Who is online

Users browsing this forum: No registered users and 1 guest

cron