From 12c00ec114b507f5c04a653cd4d843abb060ee7d Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Wed, 3 Mar 2021 12:02:11 -0500 Subject: [PATCH] added support for the New TV Agent #77 --- modules/config.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/config.py b/modules/config.py index 48f7a1b5..bd21035f 100644 --- a/modules/config.py +++ b/modules/config.py @@ -15,6 +15,7 @@ from modules.trakttv import TraktAPI from modules.tvdb import TVDbAPI from modules.util import Failed from plexapi.exceptions import BadRequest +from plexapi.media import Guid from ruamel import yaml logger = logging.getLogger("Plex Meta Manager") @@ -575,11 +576,17 @@ class Config: item_type = guid.scheme.split(".")[-1] check_id = guid.netloc - if item_type == "plex" and library.is_movie: + if item_type == "plex" and check_id == "movie": for guid_tag in item.guids: url_parsed = requests.utils.urlparse(guid_tag.id) if url_parsed.scheme == "tmdb": tmdb_id = int(url_parsed.netloc) elif url_parsed.scheme == "imdb": imdb_id = url_parsed.netloc + elif item_type == "plex" and check_id == "show": + for guid_tag in item.findItems(item._data, Guid): + url_parsed = requests.utils.urlparse(guid_tag.id) + if url_parsed.scheme == "tvdb": tvdb_id = int(url_parsed.netloc) + elif url_parsed.scheme == "imdb": imdb_id = url_parsed.netloc + elif url_parsed.scheme == "tmdb": tmdb_id = int(url_parsed.netloc) elif item_type == "imdb": imdb_id = check_id elif item_type == "thetvdb": tvdb_id = int(check_id) elif item_type == "themoviedb": tmdb_id = int(check_id)