diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2013-02-21 21:13:08 +1100 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2013-02-21 21:14:58 +1100 |
commit | a395a346719908e7d02ab7a742eb2b938dcc893d (patch) | |
tree | 67b9b0774583d1ff654c2a8ea6e7331dfae6b5c5 | |
parent | ee758c5a97f8755e5f2ae2583ce757201450c106 (diff) |
skin tags: fix the id3 track/disc numbers in conditionals
Fix the %in tag so %xd(a, %in) works as expected
Change-Id: I33dd3ae092a66b1363c9cf3afa08075e4534af7c
-rw-r--r-- | apps/gui/skin_engine/skin_tokens.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/gui/skin_engine/skin_tokens.c b/apps/gui/skin_engine/skin_tokens.c index e58393e19c..33ffc53a9c 100644 --- a/apps/gui/skin_engine/skin_tokens.c +++ b/apps/gui/skin_engine/skin_tokens.c @@ -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; } |