MusicPlayerDaemonAlbumCovers
From Music Player Daemon Community Wiki
Contents |
[edit] Introduction
Some people at the MPD IRC channel have been talking about if and how album cover support should be in MPD. For now, there are only ideas, described below. Join us and tell what you think of everything.
[edit] Fetching
This hasn't been discussed a lot. Currently, we're thinking of using the Amazon service for getting the covers, like other programs do.
I don't think mpd should do the fetching -- you never know whether the machine running mpd has internet connection, besides it needs a graphical display to check if it's the right cover. Instead why not use an external program like [Cover Art Downloader] or better yet program a specific mpd client that uses the mpd database and fetches the covers, allows a selection and stores them on the server ?
[edit] Storing
We want to use a clear and standard method of storage, so we won't reinvent the wheel and also others programs could use our covers. But currently, these methods have been presented:
- Using mp3v2 and mp4 metadata.
- Advantage: easy to maintain, many editors allow to modify the metadata.
- Disadvantage: not available for all formats supported by mpd.
- Using the FreeDesktop.org standard of desktop icons.
- Advantage: a lot of other programs, including cover downloaders and music players, already use it.
- Disadvantage: some people don't have write access for their music library. Also, this format requires that you have each album in a separate directory.
- Using a database file, like Muine does.
- Advantage: single organized file and no headaches about writing and retrieving the covers.
- Disadvantage: no other programs (or even the users) would be capable of viewing or changing the database.
- Using a directory for storing the covers image files and an index mapping each file to an album.
- Advantage: anybody can view the database and the storing is human-readable and simple.
- Disadvantage: no other programs would understand this format.
- Store the cover images in the associated album folder where the music is. MPD would check for the existence of a cover image within an album folder looking for a pre-defined filename (ie front_cover.jpg|png|bmp etc).
- Advantage: Simple human and computer readable solution.
- Advantage: All data pertaining to an album would be encapsulated in one folder.
- Advantage: Other music applications can easily access and add cover images.
- Disadvantage: Only works when albums are in folders.
- Store the cover images using the method described in the Thumbnail Management specification, possibly modified slightly.
- Only one or two changes should be necessary; first, create a "fullsize" folder, and secondly (possibly) create a separate folder, to store album cover art separately from "standard" thumbnails (eg: ".covers", instead of ".thumbnails"). This could even be done in a manner that permits the user to change cover art independently of the server (by checking first the server store, then the user's home for a ".covers" directory).
- Advantage: Widely used by existing applications.
- Advantage: filesystem exposure is relatively flat, with thumbnails stored in a shallow folder structure.
- Advantage: with the above modification, the user can change cover art, without affecting the server store.
- Disadvantage: not trivially human-readable. Thumbnails are easily viewable, but it is not trivial to identify which thumbnail matches which item, except by sight. Of course, this could be fixed by using a standardized album name, rather than a hash value for the stored thumbnail, but that might have other consequences.
[edit] Sending to the Client
After fetching and storing the covers, the MPD clients should be able to get the cover from the server. Currently, the following changes are proposed:
- The song's metadata would have a new field, saying if there's a cover avaiable for that song or not.
- If true, the client would be able to get the cover using a command, like "get_cover". The response would include the mime-type and the image encoded as base64.
