Commit 2084c519 authored by echel0n's avatar echel0n

Fixed issue `self[klass().id] = klass() TypeError: 'NoneType' object is not callable`

parent 3b88e82e
......@@ -50,9 +50,7 @@ def indexerImage(id=None, which=None):
image_type = which[0:6]
if image_type not in ('fanart', 'poster', 'banner'):
sickrage.app.log.error(
"Invalid image type " + str(image_type) + ", couldn't find it in the " + IndexerApi(
INDEXER_TVDB).name + " object")
sickrage.app.log.error("Invalid image type " + str(image_type) + ", couldn't find it in the " + IndexerApi(INDEXER_TVDB).name + " object")
return
try:
......@@ -82,5 +80,4 @@ def indexerImage(id=None, which=None):
elif image_type == 'poster':
return Poster(int(id), media_format)
except (indexer_error, IOError) as e:
sickrage.app.log.warning("{}: Unable to look up show on ".format(id) + IndexerApi(
INDEXER_TVDB).name + ", not downloading images: {}".format(e))
sickrage.app.log.warning("{}: Unable to look up show on ".format(id) + IndexerApi(INDEXER_TVDB).name + ", not downloading images: {}".format(e))
......@@ -713,7 +713,7 @@ class PipUpdateManager(UpdateManager):
def _find_installed_version(self):
out, __, exit_status = self._pip_cmd(self._pip3_path, 'show sickrage')
if exit_status == 0:
return out.split('\n')[1].split()[1]
return out.split(b'\n')[1].split()[1]
return ""
def need_update(self):
......
......@@ -30,8 +30,8 @@ class ResponseResolver:
@staticmethod
def parse(data):
resline = data.split('\n', 1)[0]
lines = data.split('\n')[1:-1]
resline = data.split(b'\n', 1)[0]
lines = data.split(b'\n')[1:-1]
rescode, resstr = resline.split(' ', 1)
if rescode[0] == 'T':
......@@ -42,7 +42,7 @@ class ResponseResolver:
datalines = []
for line in lines:
datalines.append(line.split('|'))
datalines.append(line.split(b'|'))
return restag, rescode, resstr, datalines
......
......@@ -876,8 +876,10 @@ class MetadataProviders(dict):
for name in names:
if not name:
continue
klass = self._get_klass(name.group(1))
self[klass().id] = klass()
if klass:
self[klass().id] = klass()
@staticmethod
def _get_klass(name):
......
......@@ -106,8 +106,10 @@ class NotifierProviders(dict):
for name in names:
if not name:
continue
klass = self._get_klass(name.group(1))
self[klass().id] = klass()
if klass:
self[klass().id] = klass()
@staticmethod
def _get_klass(name):
......
Markdown is supported
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