Few changes to getSearchTitle in case a title isn't found, Added check to ensure enough media was returned from _lookupMedia
This commit is contained in:
1 parent
5fdf4d9085
commit
01da470c21
1 file changed
+11
-4
@@ -37,6 +37,9 @@ class ShowSearcher(Plugin):
|
|||||||
show = media_library.parent
|
show = media_library.parent
|
||||||
season = media_library
|
season = media_library
|
||||||
|
|
||||||
|
if media['type'] == 'show':
|
||||||
|
show = media_library
|
||||||
|
|
||||||
return show, season, episode
|
return show, season, episode
|
||||||
|
|
||||||
def single(self, media, search_protocols = None):
|
def single(self, media, search_protocols = None):
|
||||||
@@ -72,6 +75,9 @@ class ShowSearcher(Plugin):
|
|||||||
return
|
return
|
||||||
|
|
||||||
show, season, episode = self._lookupMedia(media)
|
show, season, episode = self._lookupMedia(media)
|
||||||
|
if not show or not season:
|
||||||
|
log.error('Unable to find show or season library in database, missing required data for searching')
|
||||||
|
return
|
||||||
|
|
||||||
fireEvent('notify.frontend', type = 'show.searcher.started.%s' % media['id'], data = True, message = 'Searching for "%s"' % default_title)
|
fireEvent('notify.frontend', type = 'show.searcher.started.%s' % media['id'], data = True, message = 'Searching for "%s"' % default_title)
|
||||||
|
|
||||||
@@ -119,7 +125,8 @@ class ShowSearcher(Plugin):
|
|||||||
if episode is not None:
|
if episode is not None:
|
||||||
name += 'E%02d' % episode.episode_number
|
name += 'E%02d' % episode.episode_number
|
||||||
|
|
||||||
return ''.join([
|
show_title = getTitle(show)
|
||||||
getTitle(show),
|
if not show_title:
|
||||||
name
|
return None
|
||||||
])
|
|
||||||
|
return show_title + name
|
||||||
Reference in new issue
Block a user