diff options
Diffstat (limited to 'apps/recorder')
-rw-r--r-- | apps/recorder/albumart.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/apps/recorder/albumart.c b/apps/recorder/albumart.c index 0e45d9a935..13969d77e5 100644 --- a/apps/recorder/albumart.c +++ b/apps/recorder/albumart.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include "dircache.h" | 27 | #include "dircache.h" |
28 | #include "debug.h" | 28 | #include "debug.h" |
29 | #include "misc.h" | 29 | #include "misc.h" |
30 | #include "settings.h" | ||
30 | 31 | ||
31 | 32 | ||
32 | /* Strip filename from a full path | 33 | /* Strip filename from a full path |
@@ -79,6 +80,8 @@ static void fix_path_part(char* path, int offset, int count) | |||
79 | 80 | ||
80 | for (i = 0; i <= count; i++, path++) | 81 | for (i = 0; i <= count; i++, path++) |
81 | { | 82 | { |
83 | if (*path == 0) | ||
84 | return; | ||
82 | if (*path == '"') | 85 | if (*path == '"') |
83 | *path = '\''; | 86 | *path = '\''; |
84 | else if (strchr(invalid_chars, *path)) | 87 | else if (strchr(invalid_chars, *path)) |
@@ -92,6 +95,7 @@ static void fix_path_part(char* path, int offset, int count) | |||
92 | * ./cover<size>.bmp | 95 | * ./cover<size>.bmp |
93 | * ../<albumname><size>.bmp | 96 | * ../<albumname><size>.bmp |
94 | * ../cover<size>.bmp | 97 | * ../cover<size>.bmp |
98 | * ROCKBOX_DIR/albumart/<artist>-<albumname><size>.bmp | ||
95 | * <size> is the value of the size_string parameter, <trackname> and | 99 | * <size> is the value of the size_string parameter, <trackname> and |
96 | * <albumname> are read from the ID3 metadata. | 100 | * <albumname> are read from the ID3 metadata. |
97 | * If a matching bitmap is found, its filename is stored in buf. | 101 | * 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, | |||
140 | 144 | ||
141 | if (!found) | 145 | if (!found) |
142 | { | 146 | { |
147 | /* look in the albumart subdir of .rockbox */ | ||
148 | snprintf(path, sizeof(path), | ||
149 | ROCKBOX_DIR "/albumart/%s-%s%s.bmp", | ||
150 | id3->artist, | ||
151 | id3->album, | ||
152 | size_string); | ||
153 | fix_path_part(path, strlen(ROCKBOX_DIR "/albumart/"), MAX_PATH); | ||
154 | found = file_exists(path); | ||
155 | } | ||
156 | |||
157 | if (!found) | ||
158 | { | ||
143 | /* if it still doesn't exist, | 159 | /* if it still doesn't exist, |
144 | * we continue to search in the parent directory */ | 160 | * we continue to search in the parent directory */ |
145 | strcpy(path, dir); | 161 | strcpy(path, dir); |