Commit 7682ad1c authored by echel0n's avatar echel0n
Browse files

Fixed issue #153 - Checking delete files when removing a show didn't actually delete the files

Added code to remove queue item to be ignored when listing shows
parent 40fbb92a
# Changelog
- * 7bc398a - 2017-12-16: Release v9.2.65
- * b0b60fb - 2017-12-17: Fixed issue #153 - Checking delete files when removing a show didn't actually delete the files Added code to remove queue item to be ignored when listing shows
- * 3c60c67 - 2017-12-16: Release v9.2.65
- * d53ccb0 - 2017-12-16: Fixed url issue
- * 1c5d901 - 2017-12-16: refactored torrent cache api calls
- * e5ee3a3 - 2017-12-16: refactored torrent cache api calls
......
......@@ -2081,8 +2081,15 @@ jQuery(document).ready(function ($) {
$("a.removeshow").confirm({
title: gt("Remove Show"),
content: gt('Are you sure you want to remove <span class="footerhighlight">') + $('#showtitle').data('showname') + gt('</span> from the database?<br><br><input type="checkbox" id="deleteFiles" name="deleteFiles"/>&nbsp;<label for="deleteFiles" class="red-text">Check to delete files as well. IRREVERSIBLE</label>'),
confirm: function () {
location.href = this.$target.attr('href') + ($('#deleteFiles')[0].checked ? '&full=1' : '');
buttons: {
confirm: function () {
var $deleteFiles = this.$content.find('#deleteFiles').prop('checked');
location.href = this.$target.attr('href') + ($deleteFiles ? '&full=1' : '');
},
cancel: {
action: function () {
}
}
}
});
},
......
......@@ -68,6 +68,9 @@ class ShowQueue(srQueue):
def isInSubtitleQueue(self, show):
return self._isInQueue(show, (ShowQueueActions.SUBTITLE,))
def isBeingRemoved(self, show):
return self._isBeing(show, (ShowQueueActions.REMOVE,))
def isBeingAdded(self, show):
return self._isBeing(show, (ShowQueueActions.ADD,))
......@@ -622,6 +625,13 @@ class QueueItemRemove(ShowQueueItem):
self.priority = srQueuePriorities.HIGH + srQueuePriorities.HIGH
self.full = full
@property
def isLoading(self):
"""
Returns false cause we are removing the show.
"""
return False
def run(self):
sickrage.app.log.info("Removing show: {}".format(self.show.name))
......
......@@ -1079,14 +1079,29 @@ class TVShow(object):
self.saveToDB()
def deleteShow(self, full=False):
[sickrage.app.main_db.delete(x) for x in sickrage.app.main_db.get_many('tv_episodes', self.indexerid)]
[sickrage.app.main_db.delete(x) for x in sickrage.app.main_db.get_many('tv_shows', self.indexerid)]
[sickrage.app.main_db.delete(x) for x in sickrage.app.main_db.get_many('imdb_info', self.indexerid)]
[sickrage.app.main_db.delete(x) for x in sickrage.app.main_db.get_many('xem_refresh', self.indexerid)]
[sickrage.app.main_db.delete(x) for x in sickrage.app.main_db.get_many('scene_numbering', self.indexerid)]
# choose delete or trash action
action = ('delete', 'trash')[sickrage.app.config.trash_remove_show]
# remove from tv episodes table
for x in sickrage.app.main_db.get_many('tv_episodes', self.indexerid):
sickrage.app.main_db.delete(x)
# remove from tv shows table
for x in sickrage.app.main_db.get_many('tv_shows', self.indexerid):
sickrage.app.main_db.delete(x)
# remove from imdb info table
for x in sickrage.app.main_db.get_many('imdb_info', self.indexerid):
sickrage.app.main_db.delete(x)
# remove from xem scene table
for x in sickrage.app.main_db.get_many('xem_refresh', self.indexerid):
sickrage.app.main_db.delete(x)
# remove from scene numbering table
for x in sickrage.app.main_db.get_many('scene_numbering', self.indexerid):
sickrage.app.main_db.delete(x)
# remove self from show list
sickrage.app.showlist = [x for x in sickrage.app.showlist if int(x.indexerid) != self.indexerid]
......@@ -1099,7 +1114,6 @@ class TVShow(object):
send2trash.send2trash(cache_file)
else:
os.remove(cache_file)
except OSError as e:
sickrage.app.log.warning('Unable to %s %s: %s / %s' % (action, cache_file, repr(e), str(e)))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment