skin tags: fix the id3 track/disc numbers in conditionals
authorJonathan Gordon <rockbox@jdgordon.info>
Thu, 21 Feb 2013 10:13:08 +0000 (21 21:13 +1100)
committerJonathan Gordon <rockbox@jdgordon.info>
Thu, 21 Feb 2013 10:14:58 +0000 (21 21:14 +1100)
Fix the %in tag so %xd(a, %in) works as expected

Change-Id: I33dd3ae092a66b1363c9cf3afa08075e4534af7c

apps/gui/skin_engine/skin_tokens.c

index e58393e..33ffc53 100644 (file)
@@ -254,17 +254,27 @@ const char *get_id3_token(struct wps_token *token, struct mp3entry *id3,
             case SKIN_TOKEN_METADATA_GENRE:
                 return id3->genre_string;
             case SKIN_TOKEN_METADATA_DISC_NUMBER:
-                if (id3->disc_string)
+                if (id3->disc_string) {
+                    if (intval)
+                        *intval = atoi(id3->disc_string);
                     return id3->disc_string;
+                }
                 if (id3->discnum) {
+                    if (intval)
+                        *intval = id3->discnum;
                     snprintf(buf, buf_size, "%d", id3->discnum);
                     return buf;
                 }
                 return NULL;
             case SKIN_TOKEN_METADATA_TRACK_NUMBER:
-                if (id3->track_string)
+                if (id3->track_string) {
+                    if (intval)
+                        *intval = atoi(id3->track_string);
                     return id3->track_string;
+                }
                 if (id3->tracknum) {
+                    if (intval)
+                        *intval = id3->tracknum;
                     snprintf(buf, buf_size, "%d", id3->tracknum);
                     return buf;
                 }