summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/playlist_catalog.c10
-rw-r--r--apps/playlist_menu.c16
2 files changed, 16 insertions, 10 deletions
diff --git a/apps/playlist_catalog.c b/apps/playlist_catalog.c
index 0b047b0fee..54326d3ff9 100644
--- a/apps/playlist_catalog.c
+++ b/apps/playlist_catalog.c
@@ -453,13 +453,17 @@ bool catalog_add_to_a_playlist(char* sel, int sel_attr, bool new_playlist)
if (new_playlist)
{
+ size_t len;
snprintf(playlist, MAX_PATH, "%s/", playlist_dir);
if (kbd_input(playlist, MAX_PATH))
return false;
- if(strlen(playlist) <= 4 ||
- strcasecmp(&playlist[strlen(playlist)-4], ".m3u"))
- strcat(playlist, ".m3u");
+ len = strlen(playlist);
+
+ if(len > 4 && !strcasecmp(&playlist[len-4], ".m3u"))
+ strcat(playlist, "8");
+ else if(len <= 5 || strcasecmp(&playlist[len-5], ".m3u8"))
+ strcat(playlist, ".m3u8");
}
else
{
diff --git a/apps/playlist_menu.c b/apps/playlist_menu.c
index 5e73621a22..2874c3b0d2 100644
--- a/apps/playlist_menu.c
+++ b/apps/playlist_menu.c
@@ -79,19 +79,21 @@ bool playlist_menu(void)
int save_playlist_screen(struct playlist_info* playlist)
{
- char* filename;
char temp[MAX_PATH+1];
int len;
- filename = playlist_get_name(playlist, temp, sizeof(temp));
+ playlist_get_name(playlist, temp, sizeof(temp));
+ len = strlen(temp);
- if (!filename || (len=strlen(filename)) <= 5 ||
- strcasecmp(&filename[len-5], ".m3u8"))
- strcpy(filename, DEFAULT_DYNAMIC_PLAYLIST_NAME);
+ if (len > 4 && !strcasecmp(&temp[len-4], ".m3u"))
+ strcat(temp, "8");
+
+ if (len <= 5 || strcasecmp(&temp[len-5], ".m3u8"))
+ strcpy(temp, DEFAULT_DYNAMIC_PLAYLIST_NAME);
- if (!kbd_input(filename, sizeof(temp)))
+ if (!kbd_input(temp, sizeof(temp)))
{
- playlist_save(playlist, filename);
+ playlist_save(playlist, temp);
/* reload in case playlist was saved to cwd */
reload_directory();