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
This commit is contained in:
Christian Soffke 2022-10-18 04:10:29 +02:00 committed by William Wilgus
parent 55185277ba
commit 0761532d09
2 changed files with 7 additions and 13 deletions

View file

@ -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)

View file

@ -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