diff options
author | Martin Fietz <Martin.Fietz@gmail.com> | 2016-01-05 01:40:15 +0100 |
---|---|---|
committer | Martin Fietz <Martin.Fietz@gmail.com> | 2016-01-05 01:40:15 +0100 |
commit | a218665f8abb6e6a8b69360c8034b8afd0ee9bd4 (patch) | |
tree | 8cb6bdfa86978e9828c290266429b7bdefbeba55 /core/src/main | |
parent | d18efcc3b178a6ae35344a90eed09b7b1ab51689 (diff) | |
download | AntennaPod-a218665f8abb6e6a8b69360c8034b8afd0ee9bd4.zip |
When deleting a feed, also remove corresponding download log entries
Diffstat (limited to 'core/src/main')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java index 87485a237..c9dcae85d 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java @@ -886,6 +886,10 @@ public class PodDBAdapter { } public void removeFeedMedia(FeedMedia media) { + // delete download log entries for feed media + db.delete(TABLE_NAME_DOWNLOAD_LOG, KEY_FEEDFILE + "=? AND " + KEY_FEEDFILETYPE +"=?", + new String[] { String.valueOf(media.getId()), String.valueOf(FeedMedia.FEEDFILETYPE_FEEDMEDIA) }); + db.delete(TABLE_NAME_FEED_MEDIA, KEY_ID + "=?", new String[]{String.valueOf(media.getId())}); } @@ -930,6 +934,9 @@ public class PodDBAdapter { removeFeedItem(item); } } + // delete download log entries for feed + db.delete(TABLE_NAME_DOWNLOAD_LOG, KEY_FEEDFILE + "=? AND " + KEY_FEEDFILETYPE +"=?", + new String[] { String.valueOf(feed.getId()), String.valueOf(Feed.FEEDFILETYPE_FEED) }); db.delete(TABLE_NAME_FEEDS, KEY_ID + "=?", new String[]{String.valueOf(feed.getId())}); |