From 90e35716e312b9446515263f75e9e7cb66483c2c Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Thu, 30 Mar 2023 12:24:02 +0100 Subject: playlist: Rewrite playlist_save(), optimization & fixes playlist_save() was a poorly thought out mess. This fixes the glaring issues and hopefully ensures that saving the playlist never loses state (such as queued tracks or modified status) after save+resume. Indices are now updated on the fly, which is faster and needs no extra memory. But if an error occurs, the playlist will be corrupted. There is currently no attempt to handle this since errors should be unlikely, but some error handling needs to be added in the future. Change-Id: If8a5dbd6a596460be08ee0b7bab9f24337886ea4 --- apps/menus/playlist_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps/menus/playlist_menu.c') diff --git a/apps/menus/playlist_menu.c b/apps/menus/playlist_menu.c index 49ff56795a..87ed7428ea 100644 --- a/apps/menus/playlist_menu.c +++ b/apps/menus/playlist_menu.c @@ -83,7 +83,7 @@ int save_playlist_screen(struct playlist_info* playlist) playlist ? playlist->filename : playlist_get_current()->filename)) { - playlist_save(playlist, temp, NULL, 0); + playlist_save(playlist, temp); /* reload in case playlist was saved to cwd */ reload_directory(); -- cgit v1.2.3