1
0
Fork 0
forked from len0rd/rockbox

Playlist Viewer: Delete playlist when emptied

When you removed all tracks from an on-disk playlist,
you were asked whether you wanted to save it, which
would fail, but did not show any accompanying message.

Instead of trying to save the playlist, after getting
the confirmation, delete the playlist file from disk.

Change-Id: Iad54f2f490b15dd9c8a8fdfb8f12e58fd17d5e36
This commit is contained in:
Christian Soffke 2025-01-03 17:04:43 +01:00
parent 0012411fc5
commit 6a865f2430

View file

@ -638,8 +638,14 @@ static void close_playlist_viewer(void)
if (viewer.initial_selection)
*(viewer.initial_selection) = viewer.selected_track;
if(playlist_modified(viewer.playlist) && yesno_pop(ID2P(LANG_SAVE_CHANGES)))
if(playlist_modified(viewer.playlist))
{
if (viewer.num_tracks && yesno_pop(ID2P(LANG_SAVE_CHANGES)))
save_playlist_screen(viewer.playlist);
else if (!viewer.num_tracks &&
confirm_delete_yesno(viewer.playlist->filename) == YESNO_YES)
remove(viewer.playlist->filename);
}
playlist_close(viewer.playlist);
}
}