summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/wps.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/apps/wps.c b/apps/wps.c
index d2c3676d6f..e2c091fa81 100644
--- a/apps/wps.c
+++ b/apps/wps.c
@@ -191,13 +191,24 @@ static void draw_screen(struct mp3entry* id3)
case PLAY_DISPLAY_1LINEID3:
{
char buffer[64];
+ char ch = '/';
+ char* szLast = strrchr(id3->path, ch);
- snprintf(buffer, sizeof(buffer), "%d/%d: %s - %s",
- id3->index + 1,
- playlist.amount,
- id3->artist?id3->artist:"<no artist>",
- id3->title?id3->title:"<no title>");
-
+ if(id3->artist && id3->title)
+ {
+ snprintf(buffer, sizeof(buffer), "%d/%d: %s - %s",
+ id3->index + 1,
+ playlist.amount,
+ id3->artist?id3->artist:"<no artist>",
+ id3->title?id3->title:"<no title>");
+ }
+ else
+ {
+ snprintf(buffer, sizeof(buffer), "%d/%d: %s",
+ id3->index + 1,
+ playlist.amount,
+ szLast?++szLast:id3->path);
+ }
lcd_puts_scroll(0, 0, buffer);
break;
}