Simple(?) server for MPDroid

Cool stuff you can do with MPD. A place for you to put your hacks and patches, or be inspired by others'.
Post Reply
andrew@acooke.org
Posts: 3
Joined: March 16th, 2013, 11:53 am

Simple(?) server for MPDroid

Post by andrew@acooke.org » March 29th, 2013, 12:06 pm

This is kind-of an ad (but for free software). I thought someone might be interested, but apologies if this is not the correct place (where would be?).

To control the music from mpd around the house I have a Nexus 7 that runs MPDroid - a nice looking Android app that talks to mpd over wifi.

https://play.google.com/store/apps/deta ... roid&hl=en

Anyway, MPDroid pulls cover art from Last.fm. Which generally means that there is something pretty on the display, although often not the exact album cover you expect.

But it has an alternative - it can request an image from a web server, given the artist and album name. So if you keep your music in nested directories named by artist and album (as I do) and each directory has an image file (which mine don't) then you can jury rig a web server to return the images.

Now that's great, but it's complex to configure and requires those extra image files. Instead, my mp3s (like most people's) have images in the ID3 tags.

So I wrote a small Python program that (1) is an HTTP server and (2) automatically extracts the images from the mp3 files. It will also serve the extra images, if they are present.

Instead of configuring a complex HTTP server (and getting all the album image files) all you need to do is run my program. It's called id3img and you can get it from https://github.com/andrewcooke/id3img

Also, if anyone has patches to make install easier, or to make it work on windows / macs (if it doesn't already - it may do so, just isn't tested) I would be grateful to hear...

sunny25a
Posts: 2
Joined: July 27th, 2014, 2:08 pm

Re: Simple(?) server for MPDroid

Post by sunny25a » July 27th, 2014, 2:50 pm

Dear Andrew,

thanks a lot for this. I was really really surprised after installing MPD that covers have not been recognized. This is a kind of nightmare to configure. I'm pretty sure that is one reason people stay away from MPD...

So I found your small solution and wanna try. I'm not very experienced in Linux and do not fully understand your install instructions. Could you help to get this to work and finally see covers on MPD.

- In your instructions you write:

1) Install Python --> Yes 3.4 is installed
2) Clone Repo --> I downloaded this to my system
3) If you want, you can use the setup-env.sh script to create a virtualenv environment. --> I'm not sure if I need this. Sorry as I said I'm a newbie could you please explain? I tried to execute the script but only got errors:

Code: Select all

./setup-env.sh: line 4: virtualenv-3.3: command not found
./setup-env.sh: line 5: env/bin/activate: No such file or directory
./setup-env.sh: line 7: easy_install: command not found
4) Run the server. For example, PYTHONPATH=src python3.3 src/id3img/server.py /music/mp3
--> I did with: PYTHONPATH=src python3.4 src/id3img/server.py /audio/ (Audio is the Folder where all my Music is located like Artist_Album_Songs)

Only errors:

Code: Select all

Traceback (most recent call last):
  File "src/id3img/server.py", line 10, in <module>
    from stagger import read_tag
ImportError: No module named 'stagger'
Maybe I completely misunderstood your instructions...I hope not

Regards,

Alex

Post Reply