summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/wps-display.c7
-rw-r--r--apps/wps.c9
2 files changed, 13 insertions, 3 deletions
diff --git a/apps/wps-display.c b/apps/wps-display.c
index acb839e..cc8009e 100644
--- a/apps/wps-display.c
+++ b/apps/wps-display.c
@@ -414,7 +414,12 @@ static char* get_tag(struct mp3entry* id3,
#endif
case 'p': /* Playlist Position */
*flags |= WPS_REFRESH_STATIC;
- snprintf(buf, buf_size, "%d", id3->index + 1);
+ {
+ int index = id3->index - playlist_first_index();
+ if (index < 0)
+ index += playlist_amount();
+ snprintf(buf, buf_size, "%d", index + 1);
+ }
return buf;
case 'n': /* Playlist Name (without path) */
diff --git a/apps/wps.c b/apps/wps.c
index 7a22e1c..c5a27d9 100644
--- a/apps/wps.c
+++ b/apps/wps.c
@@ -223,8 +223,13 @@ bool browse_id3(void)
case 7:
lcd_puts(0, 0, str(LANG_ID3_PLAYLIST));
- snprintf(scroll_text,sizeof(scroll_text), "%d/%d",
- id3->index + 1, playlist_amount());
+ {
+ int index = id3->index - playlist_first_index();
+ if (index < 0)
+ index += playlist_amount();
+ snprintf(scroll_text,sizeof(scroll_text), "%d/%d",
+ index + 1, playlist_amount());
+ }
lcd_puts_scroll(0, 1, scroll_text);
break;