Album booklet in GMPC (or other MPD client) ?
Album booklet in GMPC (or other MPD client) ?
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) ?
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:
make it executable and assign a hotkey to it.
or if you store those in your album folder:
I hope there is no typo in that last code block
example:
Code: Select all
#!/bin/bash
pdfpath=/path/to/your/pdffiles
viewer=evince
$viewer "$pdfpath"/"$(mpc current --format '%artist%-%album%')".pdf
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) ?
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 ofRasi 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:
make it executable and assign a hotkey to it.Code: Select all
#!/bin/bash pdfpath=/path/to/your/pdffiles viewer=evince $viewer "$pdfpath"/"$(mpc current --format '%artist%-%album%')".pdf
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
$(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) ?
On a Unix system running GMPC, this seems to work quite nicely:
Best,
nbpf
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
nbpf