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
This commit is contained in:
Johannes Roos 2025-10-22 21:09:18 +02:00 committed by Solomon Peachy
parent b4a276e19e
commit 994acefa23

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;