summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Soffke <christian.soffke@gmail.com>2022-10-18 04:10:29 +0200
committerWilliam Wilgus <me.theuser@yahoo.com>2022-10-18 07:23:25 -0400
commit0761532d09de375f21c6827cf1e6cda4eeec18d5 (patch)
tree113f34423a6e1a8c6ee16d97013809799c031939
parent55185277ba64557e1ea784be970919b983348111 (diff)
downloadrockbox-0761532d09de375f21c6827cf1e6cda4eeec18d5.tar.gz
rockbox-0761532d09de375f21c6827cf1e6cda4eeec18d5.zip
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
-rw-r--r--apps/filetree.c17
-rw-r--r--apps/filetree.h3
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)
89 * avoid allocating yet another path buffer on the stack (and save some 89 * avoid allocating yet another path buffer on the stack (and save some
90 * code; the caller typically needs to create the full pathname anyway)... 90 * code; the caller typically needs to create the full pathname anyway)...
91 */ 91 */
92bool ft_play_playlist(char* pathname, char* dirname, char* filename, bool skip_dyn_warning) 92bool ft_play_playlist(char* pathname, char* dirname,
93 char* filename, bool skip_warn_and_bookmarks)
93{ 94{
94 if (global_settings.party_mode && audio_status()) 95 if (global_settings.party_mode && audio_status())
95 { 96 {
@@ -97,22 +98,14 @@ bool ft_play_playlist(char* pathname, char* dirname, char* filename, bool skip_d
97 return false; 98 return false;
98 } 99 }
99 100
100 if (bookmark_autoload(pathname)) 101 if (!skip_warn_and_bookmarks)
101 { 102 {
102 return false; 103 if (bookmark_autoload(pathname) || !warn_on_pl_erase())
104 return false;
103 } 105 }
104 106
105 splash(0, ID2P(LANG_WAIT)); 107 splash(0, ID2P(LANG_WAIT));
106 108
107 /* about to create a new current playlist...
108 * allow user to cancel the operation.
109 * Do not show if skip_dyn_warning is true */
110 if (!skip_dyn_warning)
111 {
112 if (!warn_on_pl_erase())
113 return false;
114 }
115
116 if (playlist_create(dirname, filename) != -1) 109 if (playlist_create(dirname, filename) != -1)
117 { 110 {
118 if (global_settings.playlist_shuffle) 111 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);
26int ft_enter(struct tree_context* c); 26int ft_enter(struct tree_context* c);
27int ft_exit(struct tree_context* c); 27int ft_exit(struct tree_context* c);
28int ft_build_playlist(struct tree_context* c, int start_index); 28int ft_build_playlist(struct tree_context* c, int start_index);
29bool ft_play_playlist(char* pathname, char* dirname, char* filename, bool skip_dyn_warning); 29bool ft_play_playlist(char* pathname, char* dirname,
30 char* filename, bool skip_warn_and_bookmarks);
30 31
31#endif 32#endif