From 0761532d09de375f21c6827cf1e6cda4eeec18d5 Mon Sep 17 00:00:00 2001 From: Christian Soffke Date: Tue, 18 Oct 2022 04:10:29 +0200 Subject: [PATCH] Don't autoload bookmarks after saving dynamic playlist 4f83e66 (FS#13287) introduced a useful option to immediately re-load the saved dynamic playlist, so that bookmark creation becomes possible. (Current Playlist->Reload After Saving) It seems unnecessary and won't produce the intended effect to autoload bookmarks after the playlist is saved, since playback position will be restored to where it was previously. Additionally, with "Load last Bookmark" set to "Ask", the dialog for choosing a stored bookmark will appear after the playlist has been saved. The dialog is unwanted, since: - Selecting a bookmark doesn't have expected effect - Selecting "Don't resume" will actually resume - Cancelling out of the screen will prevent the saved playlist from being loaded, without this being obvious to the user - It causes a crash if the dynamic playlist is saved from within the Playlist Viewer (both the Playlist Viewer and the bookmark selection screen use the plugin buffer) Change-Id: I7d696e56c89394b3cd10ef6acfed4ddc7e814118 --- apps/filetree.c | 17 +++++------------ apps/filetree.h | 3 ++- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/apps/filetree.c b/apps/filetree.c index 1944713d13..136a3f2ff2 100644 --- a/apps/filetree.c +++ b/apps/filetree.c @@ -89,7 +89,8 @@ int ft_build_playlist(struct tree_context* c, int start_index) * avoid allocating yet another path buffer on the stack (and save some * code; the caller typically needs to create the full pathname anyway)... */ -bool ft_play_playlist(char* pathname, char* dirname, char* filename, bool skip_dyn_warning) +bool ft_play_playlist(char* pathname, char* dirname, + char* filename, bool skip_warn_and_bookmarks) { if (global_settings.party_mode && audio_status()) { @@ -97,22 +98,14 @@ bool ft_play_playlist(char* pathname, char* dirname, char* filename, bool skip_d return false; } - if (bookmark_autoload(pathname)) + if (!skip_warn_and_bookmarks) { - return false; + if (bookmark_autoload(pathname) || !warn_on_pl_erase()) + return false; } splash(0, ID2P(LANG_WAIT)); - /* about to create a new current playlist... - * allow user to cancel the operation. - * Do not show if skip_dyn_warning is true */ - if (!skip_dyn_warning) - { - if (!warn_on_pl_erase()) - return false; - } - if (playlist_create(dirname, filename) != -1) { if (global_settings.playlist_shuffle) diff --git a/apps/filetree.h b/apps/filetree.h index 178ba0e973..7931c3c454 100644 --- a/apps/filetree.h +++ b/apps/filetree.h @@ -26,6 +26,7 @@ int ft_load(struct tree_context* c, const char* tempdir); int ft_enter(struct tree_context* c); int ft_exit(struct tree_context* c); int ft_build_playlist(struct tree_context* c, int start_index); -bool ft_play_playlist(char* pathname, char* dirname, char* filename, bool skip_dyn_warning); +bool ft_play_playlist(char* pathname, char* dirname, + char* filename, bool skip_warn_and_bookmarks); #endif