forked from len0rd/rockbox
Change the search_albumart_files "ignore track art" option to check track art last.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21126 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
b714ace163
commit
84106fd917
1 changed files with 86 additions and 70 deletions
|
|
@ -133,7 +133,7 @@ static bool try_exts(char *path, int len)
|
|||
*
|
||||
* If the first symbol in size_string is a colon (e.g. ":100x100")
|
||||
* then the colon is skipped ("100x100" will be used) and the track
|
||||
* specific image (./<trackname><size>.bmp) is not tried.
|
||||
* specific image (./<trackname><size>.bmp) is tried last instead of first.
|
||||
*/
|
||||
bool search_albumart_files(const struct mp3entry *id3, const char *size_string,
|
||||
char *buf, int buflen)
|
||||
|
|
@ -141,6 +141,8 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string,
|
|||
char path[MAX_PATH + 1];
|
||||
char dir[MAX_PATH + 1];
|
||||
bool found = false;
|
||||
int track_first = 1;
|
||||
int pass;
|
||||
const char *trackname;
|
||||
const char *artist;
|
||||
int dirlen;
|
||||
|
|
@ -155,22 +157,33 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string,
|
|||
if (strcmp(trackname, "No file!") == 0)
|
||||
return false;
|
||||
|
||||
if (*size_string == ':')
|
||||
{
|
||||
size_string++;
|
||||
track_first = 0;
|
||||
}
|
||||
|
||||
strip_filename(dir, sizeof(dir), trackname);
|
||||
dirlen = strlen(dir);
|
||||
albumlen = id3->album ? strlen(id3->album) : 0;
|
||||
|
||||
/* the first file we look for is one specific to the track playing */
|
||||
if (*size_string == ':')
|
||||
size_string++;
|
||||
else {
|
||||
strip_extension(path, sizeof(path) - strlen(size_string) - 4, trackname);
|
||||
for(pass = 0; pass < 2; pass++)
|
||||
{
|
||||
if (track_first || pass)
|
||||
{
|
||||
/* the first file we look for is one specific to the
|
||||
current track */
|
||||
strip_extension(path, sizeof(path) - strlen(size_string) - 4,
|
||||
trackname);
|
||||
strcat(path, size_string);
|
||||
strcat(path, "." EXT);
|
||||
#ifdef USE_JPEG_COVER
|
||||
#ifdef USE_JPEG_COVER
|
||||
pathlen = strlen(path);
|
||||
#endif
|
||||
#endif
|
||||
found = try_exts(path, pathlen);
|
||||
}
|
||||
if (pass)
|
||||
break;
|
||||
if (!found && albumlen > 0)
|
||||
{
|
||||
/* if it doesn't exist,
|
||||
|
|
@ -243,6 +256,9 @@ bool search_albumart_files(const struct mp3entry *id3, const char *size_string,
|
|||
found = try_exts(path, pathlen);
|
||||
}
|
||||
}
|
||||
if (found)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!found)
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue