Skip to content

Commit

Permalink
Clean empty season folders
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandog committed Jul 25, 2016
1 parent 837d3f5 commit 0578913
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sickbeard/tv.py
Original file line number Diff line number Diff line change
Expand Up @@ -1330,6 +1330,10 @@ def refresh_dir(self):
logger.log(u'Could not delete associated file: {0}. Error: {1}'.format
(related_file, e), logger.WARNING)

# clean up any empty season folders after deletion of associated files
for sub_dir in ek(os.listdir, self.location):
helpers.delete_empty_folders(ek(os.path.join, self.location, sub_dir), self.location)

if sql_l:
main_db_con = db.DBConnection()
main_db_con.mass_action(sql_l)
Expand Down

0 comments on commit 0578913

Please sign in to comment.