diff options
Diffstat (limited to 'apps/onplay.c')
-rw-r--r-- | apps/onplay.c | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/apps/onplay.c b/apps/onplay.c index d552e41826..53058b3bc9 100644 --- a/apps/onplay.c +++ b/apps/onplay.c | |||
@@ -64,6 +64,7 @@ | |||
64 | #endif | 64 | #endif |
65 | #include "playlist_menu.h" | 65 | #include "playlist_menu.h" |
66 | #include "playlist_catalog.h" | 66 | #include "playlist_catalog.h" |
67 | #include "tagtree.h" | ||
67 | 68 | ||
68 | static int context; | 69 | static int context; |
69 | static char* selected_file = NULL; | 70 | static char* selected_file = NULL; |
@@ -174,26 +175,33 @@ static bool add_to_playlist(int position, bool queue) | |||
174 | if (new_playlist) | 175 | if (new_playlist) |
175 | playlist_create(NULL, NULL); | 176 | playlist_create(NULL, NULL); |
176 | 177 | ||
177 | if ((selected_file_attr & TREE_ATTR_MASK) == TREE_ATTR_MPA) | 178 | if (context == CONTEXT_ID3DB) |
178 | playlist_insert_track(NULL, selected_file, position, queue); | ||
179 | else if (selected_file_attr & ATTR_DIRECTORY) | ||
180 | { | 179 | { |
181 | bool recurse = false; | 180 | tagtree_insert_selection_playlist(position, queue); |
182 | 181 | } | |
183 | if (global_settings.recursive_dir_insert != RECURSE_ASK) | 182 | else |
184 | recurse = (bool)global_settings.recursive_dir_insert; | 183 | { |
185 | else | 184 | if ((selected_file_attr & TREE_ATTR_MASK) == TREE_ATTR_MPA) |
185 | playlist_insert_track(NULL, selected_file, position, queue); | ||
186 | else if (selected_file_attr & ATTR_DIRECTORY) | ||
186 | { | 187 | { |
187 | /* Ask if user wants to recurse directory */ | 188 | bool recurse = false; |
188 | recurse = (gui_syncyesno_run(&message, NULL, NULL)==YESNO_YES); | 189 | |
190 | if (global_settings.recursive_dir_insert != RECURSE_ASK) | ||
191 | recurse = (bool)global_settings.recursive_dir_insert; | ||
192 | else | ||
193 | { | ||
194 | /* Ask if user wants to recurse directory */ | ||
195 | recurse = (gui_syncyesno_run(&message, NULL, NULL)==YESNO_YES); | ||
196 | } | ||
197 | |||
198 | playlist_insert_directory(NULL, selected_file, position, queue, | ||
199 | recurse); | ||
189 | } | 200 | } |
190 | 201 | else if ((selected_file_attr & TREE_ATTR_MASK) == TREE_ATTR_M3U) | |
191 | playlist_insert_directory(NULL, selected_file, position, queue, | 202 | playlist_insert_playlist(NULL, selected_file, position, queue); |
192 | recurse); | ||
193 | } | 203 | } |
194 | else if ((selected_file_attr & TREE_ATTR_MASK) == TREE_ATTR_M3U) | 204 | |
195 | playlist_insert_playlist(NULL, selected_file, position, queue); | ||
196 | |||
197 | if (new_playlist && (playlist_amount() > 0)) | 205 | if (new_playlist && (playlist_amount() > 0)) |
198 | { | 206 | { |
199 | /* nothing is currently playing so begin playing what we just | 207 | /* nothing is currently playing so begin playing what we just |
@@ -842,8 +850,7 @@ int onplay(char* file, int attr, int from) | |||
842 | 850 | ||
843 | if (context == CONTEXT_WPS || | 851 | if (context == CONTEXT_WPS || |
844 | context == CONTEXT_TREE || | 852 | context == CONTEXT_TREE || |
845 | ((context == CONTEXT_ID3DB) && | 853 | (context == CONTEXT_ID3DB)) |
846 | (attr & TREE_ATTR_MASK) == TREE_ATTR_MPA)) | ||
847 | { | 854 | { |
848 | items[i].desc = ID2P(LANG_PLAYLIST); | 855 | items[i].desc = ID2P(LANG_PLAYLIST); |
849 | items[i].function = playlist_options; | 856 | items[i].function = playlist_options; |