diff options
Diffstat (limited to 'apps/playlist_catalog.c')
-rw-r--r-- | apps/playlist_catalog.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/apps/playlist_catalog.c b/apps/playlist_catalog.c index fda91bb1ee..f5c5bcb35b 100644 --- a/apps/playlist_catalog.c +++ b/apps/playlist_catalog.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include "tree.h" | 38 | #include "tree.h" |
39 | #include "yesno.h" | 39 | #include "yesno.h" |
40 | #include "filetypes.h" | 40 | #include "filetypes.h" |
41 | #include "debug.h" | ||
41 | 42 | ||
42 | #define PLAYLIST_CATALOG_CFG ROCKBOX_DIR "/playlist_catalog.config" | 43 | #define PLAYLIST_CATALOG_CFG ROCKBOX_DIR "/playlist_catalog.config" |
43 | #define PLAYLIST_CATALOG_DEFAULT_DIR "/Playlists" | 44 | #define PLAYLIST_CATALOG_DEFAULT_DIR "/Playlists" |
@@ -212,6 +213,18 @@ static char* playlist_callback_name(int selected_item, void* data, | |||
212 | 213 | ||
213 | strncpy(buffer, playlists[selected_item], MAX_PATH); | 214 | strncpy(buffer, playlists[selected_item], MAX_PATH); |
214 | 215 | ||
216 | if (buffer[0] != '.' && !(global_settings.show_filename_ext == 1 | ||
217 | || (global_settings.show_filename_ext == 3 | ||
218 | && global_settings.dirfilter == 0))) | ||
219 | { | ||
220 | char* dot = strrchr(buffer, '.'); | ||
221 | |||
222 | if (dot != NULL) | ||
223 | { | ||
224 | *dot = '\0'; | ||
225 | } | ||
226 | } | ||
227 | |||
215 | return buffer; | 228 | return buffer; |
216 | } | 229 | } |
217 | 230 | ||
@@ -260,21 +273,12 @@ static int display_playlists(char* playlist, bool view) | |||
260 | break; | 273 | break; |
261 | 274 | ||
262 | case ACTION_STD_OK: | 275 | case ACTION_STD_OK: |
276 | snprintf(playlist, MAX_PATH, "%s/%s", playlist_dir, sel_file); | ||
277 | |||
263 | if (view) | 278 | if (view) |
264 | { | 279 | { |
265 | /* In view mode, selecting a playlist starts playback */ | 280 | /* In view mode, selecting a playlist starts playback */ |
266 | if (playlist_create(playlist_dir, sel_file) != -1) | 281 | ft_play_playlist(playlist, playlist_dir, sel_file); |
267 | { | ||
268 | if (global_settings.playlist_shuffle) | ||
269 | playlist_shuffle(current_tick, -1); | ||
270 | playlist_start(0, 0); | ||
271 | } | ||
272 | } | ||
273 | else | ||
274 | { | ||
275 | /* we found the playlist we want to add to */ | ||
276 | snprintf(playlist, MAX_PATH, "%s/%s", playlist_dir, | ||
277 | sel_file); | ||
278 | } | 282 | } |
279 | 283 | ||
280 | result = 0; | 284 | result = 0; |