summaryrefslogtreecommitdiff
path: root/apps/plugins
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/plugins
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/plugins')
-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)
1293 draw_progressbar(0, pf_idx.album_ct, "Assigning Albums"); 1293 draw_progressbar(0, pf_idx.album_ct, "Assigning Albums");
1294 for (j = 0; j < pf_idx.album_ct; j++) 1294 for (j = 0; j < pf_idx.album_ct; j++)
1295 { 1295 {
1296 /* Prevent idle poweroff */
1297 rb->reset_poweroff_timer();
1298
1296 if (rb->button_get(false) > BUTTON_NONE) 1299 if (rb->button_get(false) > BUTTON_NONE)
1297 { 1300 {
1298 if (confirm_quit()) 1301 if (confirm_quit())
@@ -1351,6 +1354,9 @@ retry_artist_lookup:
1351 /* mark duplicate albums for deletion */ 1354 /* mark duplicate albums for deletion */
1352 for (i = 0; i < pf_idx.album_ct - 1; i++) /* -1 don't check last entry */ 1355 for (i = 0; i < pf_idx.album_ct - 1; i++) /* -1 don't check last entry */
1353 { 1356 {
1357 /* Prevent idle poweroff */
1358 rb->reset_poweroff_timer();
1359
1354 int idxi = pf_idx.album_index[i].artist_idx; 1360 int idxi = pf_idx.album_index[i].artist_idx;
1355 int seeki = pf_idx.album_index[i].seek; 1361 int seeki = pf_idx.album_index[i].seek;
1356 1362
@@ -2008,6 +2014,9 @@ static bool incremental_albumart_cache(bool verbose)
2008 if (aa_cache.inspected >= pf_idx.album_ct) 2014 if (aa_cache.inspected >= pf_idx.album_ct)
2009 return false; 2015 return false;
2010 2016
2017 /* Prevent idle poweroff */
2018 rb->reset_poweroff_timer();
2019
2011 int idx, ret; 2020 int idx, ret;
2012 unsigned int hash_artist, hash_album; 2021 unsigned int hash_artist, hash_album;
2013 unsigned int format = FORMAT_NATIVE; 2022 unsigned int format = FORMAT_NATIVE;
@@ -2065,11 +2074,20 @@ static bool incremental_albumart_cache(bool verbose)
2065 2074
2066aa_failure: 2075aa_failure:
2067 if (verbose) 2076 if (verbose)
2077 {
2078 if (aa_cache.inspected >= pf_idx.album_ct)
2079 configfile_save(CONFIG_FILE, config, CONFIG_NUM_ITEMS,
2080 CONFIG_VERSION);
2068 return false; 2081 return false;
2082 }
2069 2083
2070aa_success: 2084aa_success:
2071 if (aa_cache.inspected >= pf_idx.album_ct) 2085 if (aa_cache.inspected >= pf_idx.album_ct)
2086 {
2087 configfile_save(CONFIG_FILE, config, CONFIG_NUM_ITEMS,
2088 CONFIG_VERSION);
2072 free_all_slide_prio(0); 2089 free_all_slide_prio(0);
2090 }
2073 2091
2074 if(verbose)/* direct interaction with user */ 2092 if(verbose)/* direct interaction with user */
2075 return true; 2093 return true;