summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorChristian Soffke <christian.soffke@gmail.com>2021-12-12 18:32:58 +0100
committerAidan MacDonald <amachronic@protonmail.com>2021-12-24 10:38:37 -0500
commit6b5c811d1cbd35a492ada36afb2b8d6e59b81a42 (patch)
tree86f061e4c387283a0d620bc80de07264c11a3b1c /apps
parentd04804b6ff2d3dec54b73f410706b4b678ccdaa2 (diff)
downloadrockbox-6b5c811d1cbd35a492ada36afb2b8d6e59b81a42.tar.gz
rockbox-6b5c811d1cbd35a492ada36afb2b8d6e59b81a42.zip
PictureFlow: reset idle timer when art cache is being built
- creating the album index and art cache can take longer than what the idle poweroff timer is set to, so make sure to reset it periodically - when finished, make sure progress is stored to disk immediately, so it isn't lost on idle poweroff Change-Id: Ibe88a260e4495b1bd007f37950e8c5fbc9364975
Diffstat (limited to 'apps')
-rw-r--r--apps/plugins/pictureflow/pictureflow.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c
index db04f6b89a..9592ac5266 100644
--- a/apps/plugins/pictureflow/pictureflow.c
+++ b/apps/plugins/pictureflow/pictureflow.c
@@ -1293,6 +1293,9 @@ static int create_album_index(void)
draw_progressbar(0, pf_idx.album_ct, "Assigning Albums");
for (j = 0; j < pf_idx.album_ct; j++)
{
+ /* Prevent idle poweroff */
+ rb->reset_poweroff_timer();
+
if (rb->button_get(false) > BUTTON_NONE)
{
if (confirm_quit())
@@ -1351,6 +1354,9 @@ retry_artist_lookup:
/* mark duplicate albums for deletion */
for (i = 0; i < pf_idx.album_ct - 1; i++) /* -1 don't check last entry */
{
+ /* Prevent idle poweroff */
+ rb->reset_poweroff_timer();
+
int idxi = pf_idx.album_index[i].artist_idx;
int seeki = pf_idx.album_index[i].seek;
@@ -2008,6 +2014,9 @@ static bool incremental_albumart_cache(bool verbose)
if (aa_cache.inspected >= pf_idx.album_ct)
return false;
+ /* Prevent idle poweroff */
+ rb->reset_poweroff_timer();
+
int idx, ret;
unsigned int hash_artist, hash_album;
unsigned int format = FORMAT_NATIVE;
@@ -2065,11 +2074,20 @@ static bool incremental_albumart_cache(bool verbose)
aa_failure:
if (verbose)
+ {
+ if (aa_cache.inspected >= pf_idx.album_ct)
+ configfile_save(CONFIG_FILE, config, CONFIG_NUM_ITEMS,
+ CONFIG_VERSION);
return false;
+ }
aa_success:
if (aa_cache.inspected >= pf_idx.album_ct)
+ {
+ configfile_save(CONFIG_FILE, config, CONFIG_NUM_ITEMS,
+ CONFIG_VERSION);
free_all_slide_prio(0);
+ }
if(verbose)/* direct interaction with user */
return true;