[55] fix playlist sort

pull/1058/head
meisnate12 2 years ago
parent c38ca020d0
commit 0d21ccc877

@ -1 +1 @@
1.17.3-develop54 1.17.3-develop55

@ -1653,30 +1653,6 @@ class CollectionBuilder:
break break
if not found and input_id not in self.missing_movies: if not found and input_id not in self.missing_movies:
self.missing_movies.append(input_id) self.missing_movies.append(input_id)
elif id_type in ["tvdb", "tmdb_show", "tvdb_season", "tvdb_episode"] and not self.parts_collection:
if id_type == "tmdb_show":
try:
tvdb_id = self.config.Convert.tmdb_to_tvdb(input_id, fail=True)
except Failed as e:
logger.warning(e)
continue
elif id_type == "tvdb_season":
tvdb_id, _ = input_id.split("_")
tvdb_id = int(tvdb_id)
elif id_type == "tvdb_episode":
tvdb_id, _, _ = input_id.split("_")
tvdb_id = int(tvdb_id)
else:
tvdb_id = int(input_id)
if tvdb_id not in self.ignore_ids:
found = False
for pl_library in self.libraries:
if tvdb_id in pl_library.show_map:
found = True
rating_keys = pl_library.show_map[tvdb_id]
break
if not found and tvdb_id not in self.missing_shows:
self.missing_shows.append(tvdb_id)
elif id_type == "tvdb_season" and (self.builder_level == "season" or self.playlist): elif id_type == "tvdb_season" and (self.builder_level == "season" or self.playlist):
tvdb_id, season_num = input_id.split("_") tvdb_id, season_num = input_id.split("_")
tvdb_id = int(tvdb_id) tvdb_id = int(tvdb_id)
@ -1710,6 +1686,30 @@ class CollectionBuilder:
self.missing_parts.append(f"{show_item.title} Season: {season_num} Episode: {episode_num} Missing") self.missing_parts.append(f"{show_item.title} Season: {season_num} Episode: {episode_num} Missing")
if not found and tvdb_id not in self.missing_shows and self.do_missing: if not found and tvdb_id not in self.missing_shows and self.do_missing:
self.missing_shows.append(tvdb_id) self.missing_shows.append(tvdb_id)
elif id_type in ["tvdb", "tmdb_show", "tvdb_season", "tvdb_episode"] and not self.parts_collection:
if id_type == "tmdb_show":
try:
tvdb_id = self.config.Convert.tmdb_to_tvdb(input_id, fail=True)
except Failed as e:
logger.warning(e)
continue
elif id_type == "tvdb_season":
tvdb_id, _ = input_id.split("_")
tvdb_id = int(tvdb_id)
elif id_type == "tvdb_episode":
tvdb_id, _, _ = input_id.split("_")
tvdb_id = int(tvdb_id)
else:
tvdb_id = int(input_id)
if tvdb_id not in self.ignore_ids:
found = False
for pl_library in self.libraries:
if tvdb_id in pl_library.show_map:
found = True
rating_keys = pl_library.show_map[tvdb_id]
break
if not found and tvdb_id not in self.missing_shows:
self.missing_shows.append(tvdb_id)
else: else:
continue continue

@ -1,6 +1,7 @@
from datetime import datetime from datetime import datetime
from modules import util from modules import util
from modules.util import Failed from modules.util import Failed
from json import JSONDecodeError
logger = util.logger logger = util.logger
@ -64,7 +65,10 @@ class OMDb:
self.config.Cache.update_omdb(expired, omdb, self.expiration) self.config.Cache.update_omdb(expired, omdb, self.expiration)
return omdb return omdb
else: else:
error = response.json()['Error'] try:
if error == "Request limit reached!": error = response.json()['Error']
self.limit = True if error == "Request limit reached!":
self.limit = True
except JSONDecodeError:
error = f"Invalid JSON: {response.content}"
raise Failed(f"OMDb Error: {error}") raise Failed(f"OMDb Error: {error}")

Loading…
Cancel
Save