Page 1 of 1

Album booklet in GMPC (or other MPD client) ?

Posted: June 17th, 2014, 1:21 pm
by nbpf
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.

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

Posted: September 21st, 2014, 2:25 pm
by Rasi
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 :)

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

Posted: February 1st, 2015, 3:46 pm
by nbpf
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

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

Posted: February 1st, 2015, 6:32 pm
by nbpf
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