summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Soffke <christian.soffke@gmail.com>2021-12-04 22:02:57 +0100
committerAidan MacDonald <amachronic@protonmail.com>2021-12-05 14:17:44 -0500
commitdaa3967071b53bbf1b8941babbb3d8f137c93d21 (patch)
tree0a712d6ee94cdea476ffc183f40c0cd8c7e20f80
parent81da5e64090d86b336bdb319bfbf073943551660 (diff)
downloadrockbox-daa3967071b53bbf1b8941babbb3d8f137c93d21.tar.gz
rockbox-daa3967071b53bbf1b8941babbb3d8f137c93d21.zip
Properties Plugin: Fix track or disc number not appearing
Change-Id: I20e60aefd92a2d9f1a64b6197deb6950144a9781
-rw-r--r--apps/plugins/properties.c37
1 files changed, 31 insertions, 6 deletions
diff --git a/apps/plugins/properties.c b/apps/plugins/properties.c
index 6e706248aa..839e593682 100644
--- a/apps/plugins/properties.c
+++ b/apps/plugins/properties.c
@@ -149,12 +149,37 @@ static bool file_properties(const char* selected_file)
149 "%s", id3.genre_string ? id3.genre_string : ""); 149 "%s", id3.genre_string ? id3.genre_string : "");
150 rb->snprintf(str_comment, sizeof str_comment, 150 rb->snprintf(str_comment, sizeof str_comment,
151 "%s", id3.comment ? id3.comment : ""); 151 "%s", id3.comment ? id3.comment : "");
152 rb->snprintf(str_year, sizeof str_year, 152
153 "%s", id3.year_string ? id3.year_string : ""); 153 if (id3.year_string)
154 rb->snprintf(str_discnum, sizeof str_discnum, 154 rb->snprintf(str_year, sizeof str_year,
155 "%s", id3.disc_string ? id3.disc_string : ""); 155 "%s", id3.year_string);
156 rb->snprintf(str_tracknum, sizeof str_tracknum, 156 else if (id3.year)
157 "%s", id3.track_string ? id3.track_string : ""); 157 rb->snprintf(str_year, sizeof str_year,
158 "%d", id3.year);
159 else
160 rb->snprintf(str_year, sizeof str_year,
161 "%s", "");
162
163 if (id3.disc_string)
164 rb->snprintf(str_discnum, sizeof str_discnum,
165 "%s", id3.disc_string);
166 else if (id3.discnum)
167 rb->snprintf(str_discnum, sizeof str_discnum,
168 "%d", id3.discnum);
169 else
170 rb->snprintf(str_discnum, sizeof str_discnum,
171 "%s", "");
172
173 if (id3.track_string)
174 rb->snprintf(str_tracknum, sizeof str_tracknum,
175 "%s", id3.track_string);
176 else if(id3.tracknum)
177 rb->snprintf(str_tracknum, sizeof str_tracknum,
178 "%d", id3.tracknum);
179 else
180 rb->snprintf(str_tracknum, sizeof str_tracknum,
181 "%s", "");
182
158 rb->snprintf(str_bitrate, sizeof str_bitrate, 183 rb->snprintf(str_bitrate, sizeof str_bitrate,
159 "%d kbps", id3.bitrate ? : 0); 184 "%d kbps", id3.bitrate ? : 0);
160 rb->snprintf(str_frequency, sizeof str_frequency, 185 rb->snprintf(str_frequency, sizeof str_frequency,