summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorJonas Häggqvist <rasher@rasher.dk>2008-01-19 18:05:06 +0000
committerJonas Häggqvist <rasher@rasher.dk>2008-01-19 18:05:06 +0000
commit2cffb1bf3df30d312944cc283a48c081def2fec8 (patch)
tree27c4d83cee3301578973398c6e5a05e088376d11 /apps
parent608c547aa1812de4d9e41ad34eb686c45d404e9d (diff)
downloadrockbox-2cffb1bf3df30d312944cc283a48c081def2fec8.zip
rockbox-2cffb1bf3df30d312944cc283a48c081def2fec8.tar.gz
rockbox-2cffb1bf3df30d312944cc283a48c081def2fec8.tar.bz2
rockbox-2cffb1bf3df30d312944cc283a48c081def2fec8.tar.xz
Look for albumart in .rockbox/albumart/<artist>-<album><size>.bmp in addition to the current locations.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16110 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/recorder/albumart.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/apps/recorder/albumart.c b/apps/recorder/albumart.c
index 0e45d9a..13969d7 100644
--- a/apps/recorder/albumart.c
+++ b/apps/recorder/albumart.c
@@ -27,6 +27,7 @@
#include "dircache.h"
#include "debug.h"
#include "misc.h"
+#include "settings.h"
/* Strip filename from a full path
@@ -79,6 +80,8 @@ static void fix_path_part(char* path, int offset, int count)
for (i = 0; i <= count; i++, path++)
{
+ if (*path == 0)
+ return;
if (*path == '"')
*path = '\'';
else if (strchr(invalid_chars, *path))
@@ -92,6 +95,7 @@ static void fix_path_part(char* path, int offset, int count)
* ./cover<size>.bmp
* ../<albumname><size>.bmp
* ../cover<size>.bmp
+ * ROCKBOX_DIR/albumart/<artist>-<albumname><size>.bmp
* <size> is the value of the size_string parameter, <trackname> and
* <albumname> are read from the ID3 metadata.
* If a matching bitmap is found, its filename is stored in buf.
@@ -140,6 +144,18 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string,
if (!found)
{
+ /* look in the albumart subdir of .rockbox */
+ snprintf(path, sizeof(path),
+ ROCKBOX_DIR "/albumart/%s-%s%s.bmp",
+ id3->artist,
+ id3->album,
+ size_string);
+ fix_path_part(path, strlen(ROCKBOX_DIR "/albumart/"), MAX_PATH);
+ found = file_exists(path);
+ }
+
+ if (!found)
+ {
/* if it still doesn't exist,
* we continue to search in the parent directory */
strcpy(path, dir);