raster pushed a commit to branch master.

http://git.enlightenment.org/apps/rage.git/commit/?id=ab549eb064636c9f0def41c237b5c45a55ca31ea

commit ab549eb064636c9f0def41c237b5c45a55ca31ea
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Mon Feb 17 18:42:17 2020 +0000

    parameterize cover images and add capital start of word versions
---
 src/bin/albumart.c | 53 ++++++++++++++++++++++-------------------------------
 1 file changed, 22 insertions(+), 31 deletions(-)

diff --git a/src/bin/albumart.c b/src/bin/albumart.c
index dc62a7f..3deaccb 100644
--- a/src/bin/albumart.c
+++ b/src/bin/albumart.c
@@ -350,9 +350,22 @@ albumart_file_get(const char *file)
 {
    char *tmp = alloca(strlen(file) + 1 + 100);
    char *dir, *fraw, *s;
-   const char *fname, *e;
-   const char *ext[] = { "png", "PNG", "jpg", "JPG", "jpeg", "JPEG", "jpe", 
"JPE", NULL };
-   int i;
+   const char *fname, *e, *c;
+   const char *ext[] = {
+      "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++)
      {
@@ -403,35 +416,13 @@ albumart_file_get(const char *file)
         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;
-     }
-   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++)
+   for (j = 0; (c = cover[j]) && c; j++)
      {
-        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/%s.%s", dir, c, e);
+             if (ecore_file_exists(tmp)) goto found;
+          }
      }
 
    free(dir);

-- 


Reply via email to