From 8a9dc0f22f936e3bf6f649681558fca867a0a07d Mon Sep 17 00:00:00 2001 From: Bart De Vries Date: Mon, 24 Apr 2023 14:19:43 +0200 Subject: [PATCH] Also delete partially downloaded played episodes on startup Previously only fully downloaded episodes that had been played were deleted on startup. --- src/datamanager.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/datamanager.cpp b/src/datamanager.cpp index 3e5a0cab..19826736 100644 --- a/src/datamanager.cpp +++ b/src/datamanager.cpp @@ -512,8 +512,11 @@ void DataManager::setLastPlayingEntry(const QString &id) void DataManager::deletePlayedEnclosures() { QSqlQuery query; - query.prepare(QStringLiteral("SELECT * FROM Enclosures INNER JOIN Entries ON Enclosures.id = Entries.id WHERE downloaded=:downloaded AND read=:read;")); + query.prepare( + QStringLiteral("SELECT * FROM Enclosures INNER JOIN Entries ON Enclosures.id = Entries.id WHERE" + "(downloaded=:downloaded OR downloaded=:partiallydownloaded) AND (read=:read);")); query.bindValue(QStringLiteral(":downloaded"), Enclosure::statusToDb(Enclosure::Downloaded)); + query.bindValue(QStringLiteral(":partiallydownloaded"), Enclosure::statusToDb(Enclosure::PartiallyDownloaded)); query.bindValue(QStringLiteral(":read"), true); Database::instance().execute(query); while (query.next()) {