Also delete partially downloaded played episodes on startup

Previously only fully downloaded episodes that had been played
were deleted on startup.
This commit is contained in:
Bart De Vries 2023-04-24 14:19:43 +02:00
parent 6416faab0c
commit 8a9dc0f22f
1 changed files with 4 additions and 1 deletions

View File

@ -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()) {