summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Soffke <christian.soffke@gmail.com>2022-01-03 20:34:46 +0100
committerWilliam Wilgus <me.theuser@yahoo.com>2022-01-04 18:06:42 -0500
commit122ce0089aaac340eab79f7701eb4a329e6c1c21 (patch)
tree04cc3b618fb5e9f2a41497e6468ebd2a662f1722
parentde8ee6c9e98af821bcf1579ea2edac2a561a2fee (diff)
downloadrockbox-122ce0089aaac340eab79f7701eb4a329e6c1c21.tar.gz
rockbox-122ce0089aaac340eab79f7701eb4a329e6c1c21.zip
PictureFlow: Don't insert tracks if track list not available
Change-Id: Ic6d5083bfe7daf3a8639b1405b8be9dae73eb30c
-rw-r--r--apps/plugins/pictureflow/pictureflow.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c
index 2bf4127242..b1162597f2 100644
--- a/apps/plugins/pictureflow/pictureflow.c
+++ b/apps/plugins/pictureflow/pictureflow.c
@@ -3697,14 +3697,20 @@ static bool playlist_insert(int position, bool queue, bool create_new)
3697 return true; 3697 return true;
3698} 3698}
3699 3699
3700static void track_list_ready(void) 3700static bool track_list_ready(void)
3701{ 3701{
3702 if (pf_state != pf_show_tracks) 3702 if (pf_state != pf_show_tracks)
3703 { 3703 {
3704 rb->splash(0, ID2P(LANG_WAIT)); 3704 rb->splash(0, ID2P(LANG_WAIT));
3705 create_track_index(center_slide.slide_index); 3705 create_track_index(center_slide.slide_index);
3706 if (pf_tracks.count == 0)
3707 {
3708 free_borrowed_tracks();
3709 return false;
3710 }
3706 reset_track_list(); 3711 reset_track_list();
3707 } 3712 }
3713 return true;
3708} 3714}
3709 3715
3710/** 3716/**
@@ -3721,7 +3727,13 @@ static void show_current_playlist_menu(void)
3721 rb->lcd_clear_display(); 3727 rb->lcd_clear_display();
3722 rb->lcd_update(); 3728 rb->lcd_update();
3723#endif 3729#endif
3724 track_list_ready(); 3730 if (!track_list_ready())
3731 {
3732#ifdef USEGSLIB
3733 grey_show(true);
3734#endif
3735 return;
3736 }
3725 insert_whole_album = pf_state != pf_show_tracks; 3737 insert_whole_album = pf_state != pf_show_tracks;
3726 FOR_NB_SCREENS(i) 3738 FOR_NB_SCREENS(i)
3727 rb->viewportmanager_theme_enable(i, true, NULL); 3739 rb->viewportmanager_theme_enable(i, true, NULL);
@@ -3753,7 +3765,7 @@ static bool start_playback(bool return_to_WPS)
3753 rb->lcd_update(); 3765 rb->lcd_update();
3754#endif /* USEGSLIB */ 3766#endif /* USEGSLIB */
3755 3767
3756 if (!rb->warn_on_pl_erase()) 3768 if (!rb->warn_on_pl_erase() || !track_list_ready())
3757 { 3769 {
3758#ifdef USEGSLIB 3770#ifdef USEGSLIB
3759 grey_show(true); 3771 grey_show(true);
@@ -3761,7 +3773,6 @@ static bool start_playback(bool return_to_WPS)
3761 return false; 3773 return false;
3762 } 3774 }
3763 3775
3764 track_list_ready();
3765 insert_whole_album = true; 3776 insert_whole_album = true;
3766 int start_index = pf_tracks.sel; 3777 int start_index = pf_tracks.sel;
3767 bool shuffle = rb->global_settings->playlist_shuffle; 3778 bool shuffle = rb->global_settings->playlist_shuffle;