[library] RSS - reuse db file id when performing meta scan

Fixes issue when performing an 'api/rescan' (results in RSS_SCAN_META scan type
in this module) that would result in a library_media_save() -> a readd even for
entries that already exist in db.  This would result in dropping db record, incl
play_count etc instead of an update
This commit is contained in:
whatdoineed2do/Ray 2020-04-15 18:08:00 +01:00
parent 8bba3ee913
commit 3d869b0857

View File

@ -453,6 +453,13 @@ rss_save(struct playlist_info *pli, int *count, enum rss_scan_type scan_type)
if (ret > 0) if (ret > 0)
continue; continue;
} }
else if (scan_type == RSS_SCAN_META)
{
// Using existing file id if already in library, resulting in update but preserving play_count etc
mfi.id = db_file_id_bypath(ri.url);
if (mfi.id > 0)
time_added = 0;
}
scan_metadata_stream(&mfi, ri.url); scan_metadata_stream(&mfi, ri.url);