Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix suggested file name when saving dirplay playlist

The suggested name was identical to the complete path
of the played folder, with a slash at the end, which,
if accepted, resulted in a file called only ".m3u8"
being saved there.

In case the path contained one or more dots, the string
was also stripped of the last dot and all chars following it.

Use Playlist Catalogue as the destination folder instead,
and pick last path component as the file name.

Change-Id: Ia2b7f7ebca746613d650bbab6d7a62ca1106efc6

+17 -3
+17 -3
apps/menus/playlist_menu.c
··· 51 51 uint32_t resume_elapsed; 52 52 uint32_t resume_offset; 53 53 54 - char temp[MAX_PATH+1], *dot; 54 + char temp[MAX_PATH+1], *p; 55 55 int len; 56 56 57 57 playlist_get_name(playlist, temp, sizeof(temp)-1); 58 58 59 59 len = strlen(temp); 60 - dot = strrchr(temp, '.'); 61 60 62 - if (!dot && len <= 1) 61 + if (len <= 1) /* root or dynamic playlist */ 63 62 { 64 63 catalog_get_directory(temp, sizeof(temp)); 65 64 strlcat(temp, DEFAULT_DYNAMIC_PLAYLIST_NAME, sizeof(temp)); 65 + } 66 + else if (!strcmp((temp + len - 1), "/")) /* dir playlists other than root */ 67 + { 68 + temp[len - 1] = '\0'; 69 + catalog_get_directory(directoryonly, sizeof(directoryonly)); 70 + 71 + if ((p = strrchr(temp, '/'))) /* use last path component as playlist name */ 72 + { 73 + strlcat(directoryonly, p, sizeof(directoryonly)); 74 + strlcat(directoryonly, ".m3u8", sizeof(directoryonly)); 75 + } 76 + else 77 + strlcat(directoryonly, DEFAULT_DYNAMIC_PLAYLIST_NAME, sizeof(directoryonly)); 78 + 79 + strmemccpy(temp, directoryonly, sizeof(temp)); 66 80 } 67 81 68 82 if (catalog_pick_new_playlist_name(temp, sizeof(temp),