From a7d09f8104cf74d3208123466cc0c6565425c18f Mon Sep 17 00:00:00 2001 From: Christian Soffke Date: Mon, 8 Nov 2021 05:38:58 +0100 Subject: [PATCH] PictureFlow: remember inspected album artwork Each time PictureFlow was launched, it would rebuild the album artwork cache from the beginning. Depending on the number of albums, this could take a while and resulted in choppy scrolling. PictureFlow will now remember how many albums have been inspected already, and only rescan and write new artwork when the album index cache gets updated or rebuilt. Change-Id: Icd78106dacea44b80904ac609caa355cc9113168 --- apps/plugins/pictureflow/pictureflow.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/plugins/pictureflow/pictureflow.c b/apps/plugins/pictureflow/pictureflow.c index a170a57ec4..6e6b35a892 100644 --- a/apps/plugins/pictureflow/pictureflow.c +++ b/apps/plugins/pictureflow/pictureflow.c @@ -451,6 +451,7 @@ static struct configdata config[] = { TYPE_INT, 0, 999999, { .int_p = &pf_cfg.last_album }, "last album", NULL }, { TYPE_INT, 0, 1, { .int_p = &pf_cfg.backlight_mode }, "backlight", NULL }, { TYPE_INT, 0, 999999, { .int_p = &aa_cache.idx }, "art cache pos", NULL }, + { TYPE_INT, 0, 999999, { .int_p = &aa_cache.inspected }, "art cache inspected", NULL } }; #define CONFIG_NUM_ITEMS (sizeof(config) / sizeof(struct configdata)) @@ -2002,6 +2003,7 @@ static bool create_albumart_cache(void) { draw_splashscreen(pf_idx.buf, pf_idx.buf_sz); draw_progressbar(0, pf_idx.album_ct, "Preparing artwork"); + aa_cache.inspected = 0; for (int i=0; i < pf_idx.album_ct; i++) { incremental_albumart_cache(true);