Compare commits

...

2 commits

Author SHA1 Message Date
Christian Soffke
71d2016f4d shortcuts: Power off while charging if supported
Change-Id: I33b9d643053f746d24240ba59a34a1f9c7644f3e
2025-10-26 09:25:09 -04:00
Johannes Roos
994acefa23 FS#13350: PictureFlow: Fix too few albums displayed for first artist
Using pf_idx.album_untagged_idx initialized as to -1 instead of 0,
we can get rid of buggy duplicate untagged albums while keeping "usable"
untagged albums and properly displaying all albums for the first artist
when there are no untagged ablums at all.

Change-Id: I067ce0bba4ece5e2d9466ffd075af8bf653633b4
2025-10-26 09:21:54 -04:00
2 changed files with 5 additions and 13 deletions

View file

@ -1398,7 +1398,7 @@ static int create_album_index(void)
/* Albums */
pf_idx.album_ct = 0;
pf_idx.album_len =0;
pf_idx.album_untagged_idx = 0;
pf_idx.album_untagged_idx = -1;
pf_idx.album_untagged_seek = -1;
/* album_index starts at end of buf it will be rearranged when finalized */
@ -1523,16 +1523,8 @@ retry_artist_lookup:
/* remove any extra untagged albums
* extra space is orphaned till restart */
for (i = 0; i < pf_idx.album_ct; i++)
{
if (pf_idx.album_index[i].artist_idx > 0)
{
if (i > 0) { i--; }
pf_idx.album_index += i;
pf_idx.album_ct -= i;
break;
}
}
pf_idx.album_index += pf_idx.album_untagged_idx + 1;
pf_idx.album_ct -= pf_idx.album_untagged_idx + 1;
pf_idx.buf = buf;
pf_idx.buf_sz = buf_size;

View file

@ -821,7 +821,7 @@ int do_shortcut_menu(void *ignored)
run_debug_screen(sc->u.path);
break;
case SHORTCUT_SHUTDOWN:
#if CONFIG_CHARGING
#if CONFIG_CHARGING && !defined(HAVE_POWEROFF_WHILE_CHARGING)
if (charger_inserted())
charging_splash();
else
@ -829,7 +829,7 @@ int do_shortcut_menu(void *ignored)
sys_poweroff();
break;
case SHORTCUT_REBOOT:
#if CONFIG_CHARGING
#if CONFIG_CHARGING && !defined(HAVE_POWEROFF_WHILE_CHARGING)
if (charger_inserted())
charging_splash();
else