From 3d869b0857bcda324248eaae1204e5b5036da6f8 Mon Sep 17 00:00:00 2001 From: whatdoineed2do/Ray Date: Wed, 15 Apr 2020 18:08:00 +0100 Subject: [PATCH] [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 --- src/library/rssscanner.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/library/rssscanner.c b/src/library/rssscanner.c index a7a0ec8a..2a57c1db 100644 --- a/src/library/rssscanner.c +++ b/src/library/rssscanner.c @@ -453,6 +453,13 @@ rss_save(struct playlist_info *pli, int *count, enum rss_scan_type scan_type) if (ret > 0) 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);