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.
This commit is contained in:
parent
dd706ad85b
commit
bd21be1bea
|
@ -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')
|
||||
|
|
Loading…
Reference in New Issue