Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

PictureFlow: Offer to update cache if tracks not retrievable

Present user with a prompt, so that they don't
have to manually execute "Update cache" from
the settings menu after a database update

Change-Id: Ie2157f04329e8ffc10afbeb047486fe4b0b70bcf

authored by

Christian Soffke and committed by
Solomon Peachy
8d50ac77 003da4d2

+34 -3
+34 -3
apps/plugins/pictureflow/pictureflow.c
··· 3983 3983 /** 3984 3984 Display the list of tracks 3985 3985 */ 3986 - static void show_track_list(void) 3986 + static bool show_track_list(void) 3987 3987 { 3988 3988 mylcd_clear_display(); 3989 3989 if ( center_slide.slide_index != pf_tracks.cur_idx ) { ··· 3996 3996 { 3997 3997 pf_state = pf_cover_out; 3998 3998 free_borrowed_tracks(); 3999 - return; 3999 + return false; 4000 4000 } 4001 4001 reset_track_list(); 4002 4002 } ··· 4030 4030 mylcd_putsxy(titletxt_x,titletxt_y,trackname); 4031 4031 titletxt_y += titletxt_h; 4032 4032 } 4033 + 4034 + return true; 4033 4035 } 4034 4036 4035 4037 static void select_next_track(void) ··· 4642 4644 return false; 4643 4645 } 4644 4646 4647 + static bool prompt_reinit(void) 4648 + { 4649 + const struct text_message prompt = { 4650 + (const char*[]) {ID2P(LANG_TAGCACHE_BUSY), ID2P(LANG_TAGCACHE_UPDATE)}, 2}; 4651 + #ifdef USEGSLIB 4652 + grey_show(false); 4653 + #endif 4654 + if (rb->gui_syncyesno_run(&prompt, NULL, NULL) == YESNO_YES) 4655 + { 4656 + pf_cfg.update_albumart = true; 4657 + pf_cfg.cache_version = CACHE_REBUILD; 4658 + rb->remove(EMPTY_SLIDE); 4659 + configfile_save(CONFIG_FILE, config, CONFIG_NUM_ITEMS, CONFIG_VERSION); 4660 + if (!reinit()) 4661 + return false; 4662 + } 4663 + else 4664 + { 4665 + #ifdef USEGSLIB 4666 + grey_show(true); 4667 + #endif 4668 + mylcd_set_drawmode(DRMODE_FG); 4669 + } 4670 + return true; 4671 + } 4672 + 4645 4673 /** 4646 4674 Main function that also contain the main plasma 4647 4675 algorithm. ··· 4687 4715 instant_update = true; 4688 4716 break; 4689 4717 case pf_show_tracks: 4690 - show_track_list(); 4718 + if (!show_track_list() && !prompt_reinit()) 4719 + return PLUGIN_OK; 4691 4720 break; 4692 4721 case pf_idle: 4693 4722 show_tracks_while_browsing = false; ··· 4887 4916 context_menu_cleanup(); 4888 4917 if ( ret != 0 ) return ret; 4889 4918 } 4919 + else if (!prompt_reinit()) 4920 + return PLUGIN_OK; 4890 4921 } 4891 4922 break; 4892 4923 #endif