kylejohnson / Patiobar

A web frontend for pianobar, which is a CLI frontend for Pandora.
MIT License
62 stars 22 forks source link

modification help: download/serve album art vs. requesting from remote media server #16

Closed hatcreek68 closed 6 years ago

hatcreek68 commented 6 years ago

I access patiobar from a remote location; anything w/ "pandora" in the URL is blocked, so only about 1/2 of the album art pulls up. To circumvent this I'd like to, instead, have patiobar download the coverart to /home/pi/patiobar/tempart/image.png .... then index.html can pull from this ever changing file.

I don't know how complicated or simple this might be; can one of the files just have a line added to download the coverart variable to a local folder?

I see how this may not be good for the main code, as you may not want the extra bandwidth serving images from the pi vs. from the source, but it would be nice to modify it for my needs if you can send me in the right direction.

hatcreek68 commented 6 years ago

added this to eventcmd.sh

#download/serve art; remember to modify index.html also
rm -rf views/art/* #clear old art
curl "${coverArt}" --create-dirs -o "views/art/${coverArt}" #download current art

Then updated views/index.html <img class="center-block img-rounded img-responsive" id="coverArt" ng-src="<URL/IP>/art/{{src}}" alt="{{alt}}" width="400" height="400"> URL/IP could be remote URL/DNS or local RPi IP