parameterize cover images and add capital start of word versions
This commit is contained in:
parent
b05552c4f1
commit
ab549eb064
|
@ -350,9 +350,22 @@ albumart_file_get(const char *file)
|
||||||
{
|
{
|
||||||
char *tmp = alloca(strlen(file) + 1 + 100);
|
char *tmp = alloca(strlen(file) + 1 + 100);
|
||||||
char *dir, *fraw, *s;
|
char *dir, *fraw, *s;
|
||||||
const char *fname, *e;
|
const char *fname, *e, *c;
|
||||||
const char *ext[] = { "png", "PNG", "jpg", "JPG", "jpeg", "JPEG", "jpe", "JPE", NULL };
|
const char *ext[] = {
|
||||||
int i;
|
"png", "PNG",
|
||||||
|
"jpg", "JPG",
|
||||||
|
"jpeg", "JPEG",
|
||||||
|
"jpe", "JPE",
|
||||||
|
NULL };
|
||||||
|
const char *cover[] = {
|
||||||
|
"cover", "Cover", "COVER",
|
||||||
|
"front", "Front", "FRONT",
|
||||||
|
"folder", "Folder", "FOLDER",
|
||||||
|
".cover", ".Cover", ".COVER",
|
||||||
|
".front", ".Front", ".FRONT",
|
||||||
|
".folder", ".Folder", ".FOLDER",
|
||||||
|
NULL };
|
||||||
|
int i, j;
|
||||||
|
|
||||||
for (i = 0; (e = ext[i]) && e; i++)
|
for (i = 0; (e = ext[i]) && e; i++)
|
||||||
{
|
{
|
||||||
|
@ -403,35 +416,13 @@ albumart_file_get(const char *file)
|
||||||
if (ecore_file_exists(tmp)) goto found;
|
if (ecore_file_exists(tmp)) goto found;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; (e = ext[i]) && e; i++)
|
for (j = 0; (c = cover[j]) && c; j++)
|
||||||
{
|
{
|
||||||
sprintf(tmp, "%s/cover.%s", dir, e);
|
for (i = 0; (e = ext[i]) && e; i++)
|
||||||
if (ecore_file_exists(tmp)) goto found;
|
{
|
||||||
}
|
sprintf(tmp, "%s/%s.%s", dir, c, e);
|
||||||
for (i = 0; (e = ext[i]) && e; i++)
|
if (ecore_file_exists(tmp)) goto found;
|
||||||
{
|
}
|
||||||
sprintf(tmp, "%s/front.%s", dir, e);
|
|
||||||
if (ecore_file_exists(tmp)) goto found;
|
|
||||||
}
|
|
||||||
for (i = 0; (e = ext[i]) && e; i++)
|
|
||||||
{
|
|
||||||
sprintf(tmp, "%s/folder.%s", dir, e);
|
|
||||||
if (ecore_file_exists(tmp)) goto found;
|
|
||||||
}
|
|
||||||
for (i = 0; (e = ext[i]) && e; i++)
|
|
||||||
{
|
|
||||||
sprintf(tmp, "%s/.cover.%s", dir, e);
|
|
||||||
if (ecore_file_exists(tmp)) goto found;
|
|
||||||
}
|
|
||||||
for (i = 0; (e = ext[i]) && e; i++)
|
|
||||||
{
|
|
||||||
sprintf(tmp, "%s/.front.%s", dir, e);
|
|
||||||
if (ecore_file_exists(tmp)) goto found;
|
|
||||||
}
|
|
||||||
for (i = 0; (e = ext[i]) && e; i++)
|
|
||||||
{
|
|
||||||
sprintf(tmp, "%s/.folder.%s", dir, e);
|
|
||||||
if (ecore_file_exists(tmp)) goto found;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
free(dir);
|
free(dir);
|
||||||
|
|
Loading…
Reference in New Issue