SQLite Store: Fix updating track entries

Track entries are updated when files are added and their metadata is
later loaded. The refresh cycle was failing, because dbIndex was unset
in the new tracks, for some reason. Now it will set this when updating
the track item, assuming it read from the database in the first place.

This fixes metadata being loaded properly on adding tracks to the
playlist, as well as reloading track data manually.

Fixes #218, hopefully.

Signed-off-by: Christopher Snowhill <kode54@gmail.com>
CQTexperiment
Christopher Snowhill 2022-01-27 00:05:02 -08:00
parent 2e41e7c525
commit b0fca5127f
1 changed files with 6 additions and 1 deletions

View File

@ -1254,11 +1254,16 @@ static SQLiteStore *g_sharedStore = NULL;
return;
}
if (trackId != [track dbIndex])
if (trackId != [track dbIndex] && [track dbIndex] != 0)
{
[self removeString:urlId];
return;
}
if ([track dbIndex] == 0)
{
[track setDbIndex:trackId];
}
st = stmt[stmt_select_track_data];