From f6370c6756594d558b4016a59ced8729ad505570 Mon Sep 17 00:00:00 2001 From: echel0n Date: Tue, 2 Dec 2014 23:03:40 -0800 Subject: [PATCH] Fix for issue #1010 - EZRSS issues with attribute name change from filename to fileName --- sickbeard/providers/ezrss.py | 33 +++++++++++++-------------------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/sickbeard/providers/ezrss.py b/sickbeard/providers/ezrss.py index 20cdc834..00c9cfc0 100644 --- a/sickbeard/providers/ezrss.py +++ b/sickbeard/providers/ezrss.py @@ -55,11 +55,10 @@ class EZRSSProvider(generic.TorrentProvider): def getQuality(self, item, anime=False): - if not 'filename' in item: - return Quality.UNKNOWN - - filename = item.filename - quality = Quality.sceneQuality(filename, anime) + try: + quality = Quality.sceneQuality(item.filename, anime) + except: + quality = Quality.UNKNOWN return quality @@ -138,23 +137,20 @@ class EZRSSProvider(generic.TorrentProvider): if title and url: logger.log(u"RSS Feed provider: [" + self.name + "] Attempting to add item to cache: " + title, logger.DEBUG) results.append(curItem) - else: - logger.log( - u"The XML returned from the " + self.name + " RSS feed is empty or incomplete, this result is unusable", - logger.ERROR) return results def _get_title_and_url(self, item): (title, url) = generic.TorrentProvider._get_title_and_url(self, item) - if 'filename' in item: - filename = item.filename - if filename: - new_title = self._extract_name_from_filename(filename) - if new_title: - title = new_title - logger.log(u"Extracted the name " + title + " from the torrent link", logger.DEBUG) + try: + new_title = self._extract_name_from_filename(item.filename) + except: + new_title = None + + if new_title: + title = new_title + logger.log(u"Extracted the name " + title + " from the torrent link", logger.DEBUG) return (title, url) @@ -185,9 +181,6 @@ class EZRSSCache(tvcache.TVCache): data = self.getRSSFeed(rss_url) - if data and 'entries' in data: - return data.entries - else: - return [] + return data.entries or [] provider = EZRSSProvider()