def remove_show(self, beid):
"""Remove a given show from sonarr.
It will not delete files. The backend ID we're given is not the ID we need, so the show
is looked up first. It will only delete shows if the DELETE_SHOWS config value is set.
Args:
beid (int): The TVDB ID of the show.
"""
_logger.debug("Entering remove_show. Getting all shows being watched from sonarr.")
if self._delete_shows:
_logger.debug("Config line set to delete shows from sonarr. Continuing.")
shows = self.get_watching_shows()
_logger.debug("Got all shows. Attempting to find show with ID {0}".format(beid))
show = [x for x in shows if x['beid'] == beid][0]
_logger.debug("Found show {0}. Deleting.".format(show['title']))
requests.delete("{0}/api/series/{1}?apikey={2}".format(self.url, show['id'], self.api_key))
_logger.debug("Config line set to leave shows in sonarr, exiting with no changes.")
评论列表
文章目录