diff options
Diffstat (limited to 'apps/tree.c')
-rw-r--r-- | apps/tree.c | 61 |
1 files changed, 32 insertions, 29 deletions
diff --git a/apps/tree.c b/apps/tree.c index eec71aeb93..a88d58b165 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -1376,40 +1376,43 @@ static bool add_dir(char* dirname, int len, int fd) | |||
1376 | else { | 1376 | else { |
1377 | int x = strlen(entry->d_name); | 1377 | int x = strlen(entry->d_name); |
1378 | unsigned int i; | 1378 | unsigned int i; |
1379 | char *cp; | 1379 | char *cp = strrchr(entry->d_name,'.'); |
1380 | 1380 | ||
1381 | /* add all supported audio files to playlists */ | 1381 | if (cp) { |
1382 | for (i=0; i < sizeof(filetypes); i++) { | 1382 | cp++; |
1383 | if (filetypes[i].tree_attr == TREE_ATTR_MPA) { | 1383 | |
1384 | cp=strrchr(entry->d_name,'.'); | 1384 | /* add all supported audio files to playlists */ |
1385 | if (cp) cp++; | 1385 | for (i=0; i < sizeof(filetypes); i++) { |
1386 | if ((!strcasecmp(cp,filetypes[i].extension)) && (cp)) | 1386 | if (filetypes[i].tree_attr == TREE_ATTR_MPA) { |
1387 | { | 1387 | if (!strcasecmp(cp, filetypes[i].extension)) |
1388 | char buf[8]; | 1388 | { |
1389 | write(fd, dirname, strlen(dirname)); | 1389 | char buf[8]; |
1390 | write(fd, "/", 1); | 1390 | write(fd, dirname, strlen(dirname)); |
1391 | write(fd, entry->d_name, x); | 1391 | write(fd, "/", 1); |
1392 | write(fd, "\n", 1); | 1392 | write(fd, entry->d_name, x); |
1393 | 1393 | write(fd, "\n", 1); | |
1394 | plsize++; | 1394 | |
1395 | snprintf(buf, sizeof buf, "%d", plsize); | 1395 | plsize++; |
1396 | snprintf(buf, sizeof buf, "%d", plsize); | ||
1396 | #ifdef HAVE_LCD_BITMAP | 1397 | #ifdef HAVE_LCD_BITMAP |
1397 | lcd_puts(0,4,buf); | 1398 | lcd_puts(0,4,buf); |
1398 | lcd_update(); | 1399 | lcd_update(); |
1399 | #else | 1400 | #else |
1400 | x = 10; | 1401 | x = 10; |
1401 | if (plsize > 999) | 1402 | if (plsize > 999) |
1402 | x=7; | 1403 | x=7; |
1403 | else { | ||
1404 | if (plsize > 99) | ||
1405 | x=8; | ||
1406 | else { | 1404 | else { |
1407 | if (plsize > 9) | 1405 | if (plsize > 99) |
1408 | x=9; | 1406 | x=8; |
1407 | else { | ||
1408 | if (plsize > 9) | ||
1409 | x=9; | ||
1410 | } | ||
1409 | } | 1411 | } |
1410 | } | 1412 | lcd_puts(x,0,buf); |
1411 | lcd_puts(x,0,buf); | ||
1412 | #endif | 1413 | #endif |
1414 | break; | ||
1415 | } | ||
1413 | } | 1416 | } |
1414 | } | 1417 | } |
1415 | } | 1418 | } |