summaryrefslogtreecommitdiff
path: root/storage/database
diff options
context:
space:
mode:
authorByteHamster <ByteHamster@users.noreply.github.com>2023-03-11 17:44:21 +0100
committerGitHub <noreply@github.com>2023-03-11 17:44:21 +0100
commit86c11584b599bced9980f8c188e2f5e94b37e718 (patch)
tree2227a3a661d492a517b5dfee8d0d6bd8d4972bea /storage/database
parent835f007b675e06033daf55aa0b98b0cbb5ca675c (diff)
downloadAntennaPod-86c11584b599bced9980f8c188e2f5e94b37e718.zip
Automatically clear old download log entries on upgrade (#6370)
Diffstat (limited to 'storage/database')
-rw-r--r--storage/database/src/main/java/de/danoeh/antennapod/storage/database/PodDBAdapter.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/storage/database/src/main/java/de/danoeh/antennapod/storage/database/PodDBAdapter.java b/storage/database/src/main/java/de/danoeh/antennapod/storage/database/PodDBAdapter.java
index 849110a22..6802dfcc3 100644
--- a/storage/database/src/main/java/de/danoeh/antennapod/storage/database/PodDBAdapter.java
+++ b/storage/database/src/main/java/de/danoeh/antennapod/storage/database/PodDBAdapter.java
@@ -1477,6 +1477,9 @@ public class PodDBAdapter {
public void onUpgrade(final SQLiteDatabase db, final int oldVersion, final int newVersion) {
Log.w("DBAdapter", "Upgrading from version " + oldVersion + " to " + newVersion + ".");
DBUpgrader.upgrade(db, oldVersion, newVersion);
+
+ db.execSQL("DELETE FROM " + PodDBAdapter.TABLE_NAME_DOWNLOAD_LOG + " WHERE "
+ + PodDBAdapter.KEY_COMPLETION_DATE + "<" + (System.currentTimeMillis() - 7L * 24L * 3600L * 1000L));
}
}
}