[19] check ids when multiple are received from plex

pull/2056/head
meisnate12 6 months ago
parent d0dfcef312
commit 4541e7a73d

@ -1 +1 @@
2.0.1-develop18 2.0.1-develop19

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 KiB

@ -378,10 +378,28 @@ class Library(ABC):
id_type, main_id, imdb_id = self.config.Convert.get_id(item, self) id_type, main_id, imdb_id = self.config.Convert.get_id(item, self)
if main_id: if main_id:
if id_type == "movie": if id_type == "movie":
self.movie_rating_key_map[key] = main_id[0] if len(main_id) > 1:
for _id in main_id:
try:
self.config.TMDb.get_movie(_id)
self.movie_rating_key_map[key] = _id
break
except Failed:
pass
else:
self.movie_rating_key_map[key] = main_id[0]
util.add_dict_list(main_id, key, self.movie_map) util.add_dict_list(main_id, key, self.movie_map)
elif id_type == "show": elif id_type == "show":
self.show_rating_key_map[key] = main_id[0] if len(main_id) > 1:
for _id in main_id:
try:
self.config.Convert.tvdb_to_tmdb(_id, fail=True)
self.show_rating_key_map[key] = _id
break
except Failed:
pass
else:
self.show_rating_key_map[key] = main_id[0]
util.add_dict_list(main_id, key, self.show_map) util.add_dict_list(main_id, key, self.show_map)
if imdb_id: if imdb_id:
self.imdb_rating_key_map[key] = imdb_id[0] self.imdb_rating_key_map[key] = imdb_id[0]

Loading…
Cancel
Save