Getting Covers To Show Up From MPD to MPDroid – SOLVED

I use MPD (the music player daemon) for my everyday music playing – both around the house and streaming to my phone. It’s great being able to play whatever music (or playlist) I want without relying on someone else’s webserver, decisions on what ads to play, and so on.

There’s a little bit of a hiccup, though, in serving out covers to your phone client. (I use MPDroid (Google Play, GitHub), but this happens with other clients.)  You can try having it search online sources, but sometimes they’re wrong, and dammit, I didn’t spend all this time tagging my music collection properly to have it screw up.

You can have your covers on any server – I put together a one-liner script to be able to export your covers (only) to your webserver – which is nice.

But I kept having problems where MPDroid wasn’t pulling in covers from the LAN, even though I followed the directions on the wiki. (I use apache instead of nginx or lightppd, but still.) Which is strange, because when I looked at the server logs, MPDroid actually looks for LOTS of variations of the cover name, even when you’ve got it set up to look for a specific file name:

So what was going on? Turns out that I was a little too smart for my own good, and the answer was implied in the wiki page. See all those 301 redirects? I’d set up my server to only serve out HTTPS links (as one should). And that’s what screwed me up.  I had this in my .conf file for my server:

RewriteEngine On

RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

It was easily fixed by adding a line (or two, because I couldn’t remember whether it was “cover” or “covers”) so that those are served directly over HTTP:

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/cover
RewriteCond %{QUERY_STRING} !^/covers
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

And with that, boom, I was getting my covers quickly and smoothly, directly from my own server again.