From bd21be1bea5dfd4d8ad3ade8d59a762b0ce2e5bd Mon Sep 17 00:00:00 2001 From: Thomas Perl Date: Mon, 28 Jun 2010 16:03:54 +0200 Subject: [PATCH] Delete M3U when removing a podcast (bug 1063) When a podcast has its downloaded files removed, the M3U playlist file corresponding to the podcast should also be removed from the filesystem. --- src/gpodder/model.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/gpodder/model.py b/src/gpodder/model.py index 2b1d6e7d..b59cc239 100644 --- a/src/gpodder/model.py +++ b/src/gpodder/model.py @@ -611,9 +611,15 @@ class PodcastChannel(PodcastModelObject): save_dir = property(fget=get_save_dir) - def remove_downloaded( self): - shutil.rmtree( self.save_dir, True) - + def remove_downloaded(self): + # Remove the playlist file if it exists + m3u_filename = self.get_playlist_filename() + if os.path.exists(m3u_filename): + util.delete_file(m3u_filename) + + # Remove the download directory + shutil.rmtree(self.save_dir, True) + @property def cover_file(self): new_name = os.path.join(self.save_dir, 'folder.jpg') -- 2.11.4.GIT