diff --git a/src/de/podfetcher/activity/FeedlistActivity.java b/src/de/podfetcher/activity/FeedlistActivity.java index 83dd358f2..fb5d67cb8 100644 --- a/src/de/podfetcher/activity/FeedlistActivity.java +++ b/src/de/podfetcher/activity/FeedlistActivity.java @@ -58,7 +58,6 @@ public class FeedlistActivity extends SherlockListActivity { super.onResume(); IntentFilter filter = new IntentFilter(); filter.addAction(FeedSyncService.ACTION_FEED_SYNC_COMPLETED); - filter.addAction(DownloadRequester.ACTION_IMAGE_DOWNLOAD_COMPLETED); registerReceiver(contentUpdate, filter); } diff --git a/src/de/podfetcher/service/DownloadService.java b/src/de/podfetcher/service/DownloadService.java index 77e651a2c..8096b6aca 100644 --- a/src/de/podfetcher/service/DownloadService.java +++ b/src/de/podfetcher/service/DownloadService.java @@ -122,6 +122,7 @@ public class DownloadService extends Service { /** Takes a single Feed, parses the corresponding file and refreshes information in the manager */ class FeedSyncThread implements Runnable { + private static final String TAG = "FeedSyncThread"; private Feed feed; private DownloadService service; @@ -145,10 +146,18 @@ public class DownloadService extends Service { requester.downloadImage(service, feed.getImage()); } requester.removeFeed(feed); + + cleanup(); + // Save information of feed in DB manager.updateFeed(service, feed); - Log.d(TAG, "Walking through " + feed.getItems().size() + " feeditems"); - Log.d(TAG, "Done."); + } + + /** Delete files that aren't needed anymore */ + private void cleanup() { + if(new File(feed.getFile_url()).delete()) + Log.d(TAG, "Successfully deleted cache file."); else Log.e(TAG, "Failed to delete cache file."); + feed.setFile_url(null); } }