Fix bug with feeds with multiple enclosures per entry

BUG: 440389
This commit is contained in:
Bart De Vries 2021-07-30 08:44:43 +02:00
parent 00be5e3872
commit 6eb13167f2
1 changed files with 4 additions and 1 deletions

View File

@ -344,7 +344,10 @@ void Fetcher::processEnclosure(Syndication::EnclosurePtr enclosure, Syndication:
query.next();
if (query.value(0).toInt() != 0)
query.prepare(QStringLiteral("UPDATE Enclosures SET feed=:feed, id=:id, duration=:duration, size=:size, title=:title, type=:type, url=:url;"));
query.prepare(QStringLiteral(
"UPDATE Enclosures SET feed=:feed, id=:id, duration=:duration, size=:size, title=:title, type=:type, url=:url WHERE feed=:feed AND id=:id;"));
// NOTE: In case more than one enclosure is present per episode, only
// the last one will end up in the database
else
query.prepare(QStringLiteral("INSERT INTO Enclosures VALUES (:feed, :id, :duration, :size, :title, :type, :url, :playposition, :downloaded);"));