From 4e39f31c945d14fe87f288ad03e229ebf4ddd339 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Thu, 31 Mar 2022 16:10:37 -0400 Subject: [PATCH] [47] fixes --- VERSION | 2 +- modules/config.py | 2 +- modules/letterboxd.py | 6 ++---- modules/meta.py | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/VERSION b/VERSION index f2600895..207dd692 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.16.2-develop46 +1.16.2-develop47 diff --git a/modules/config.py b/modules/config.py index 1fe5212b..6dad35dc 100644 --- a/modules/config.py +++ b/modules/config.py @@ -671,7 +671,7 @@ class ConfigFile: params["radarr_add_all_existing"] = check_for_attribute(lib, "radarr_add_all_existing", var_type="bool", default=False, save=False, do_print=False) params["sonarr_add_all_existing"] = check_for_attribute(lib, "sonarr_add_all_existing", var_type="bool", default=False, save=False, do_print=False) params["missing_path"] = None - if "missing_path" in lib and lib["missing_path"]: + if lib and "missing_path" in lib and lib["missing_path"]: if os.path.exists(os.path.dirname(os.path.abspath(lib["missing_path"]))): params["missing_path"] = lib["missing_path"] else: diff --git a/modules/letterboxd.py b/modules/letterboxd.py index a2f60916..21953cd8 100644 --- a/modules/letterboxd.py +++ b/modules/letterboxd.py @@ -15,13 +15,11 @@ class Letterboxd: if self.config.trace_mode: logger.debug(f"URL: {list_url}") response = self.config.get_html(list_url, headers=util.header(language)) - letterboxd_ids = response.xpath("//li[contains(@class, 'poster-container')]/div/@data-film-id") + letterboxd_ids = response.xpath("//li[contains(@class, 'poster-container') or contains(@class, 'film-detail')]/div/@data-film-id") items = [] for letterboxd_id in letterboxd_ids: slugs = response.xpath(f"//div[@data-film-id='{letterboxd_id}']/@data-film-slug") - items.append((letterboxd_id, slugs[0])) - slugs = response.xpath(f"//div[@data-film-id='{letterboxd_id}']/@data-film-slug") - notes = response.xpath(f"//div[@data-film-id='{letterboxd_id}']/parent::li/div[@class='film-detail-content']/div/p/text()") + notes = response.xpath(f"//div[@data-film-id='{letterboxd_id}']/parent::li/div[@class='film-detail-content']/div/p/text()") if list_url.endswith(("/detail", "/detail/")) ratings = response.xpath(f"//div[@data-film-id='{letterboxd_id}']/parent::li/div[@class='film-detail-content']//span[contains(@class, 'rating')]/@class") years = response.xpath(f"//div[@data-film-id='{letterboxd_id}']/parent::li/div[@class='film-detail-content']/h2/small/a/text()") rating = None diff --git a/modules/meta.py b/modules/meta.py index 1fe47b46..400773a1 100644 --- a/modules/meta.py +++ b/modules/meta.py @@ -399,7 +399,7 @@ class MetadataFile(DataFile): person_count += 1 except TMDbNotFound: logger.error(f"TMDb Error: Actor {role['name']} Not Found") - default_template = {"tmdb_person": "<>", "plex_search": {"all": {auto_type: "tmdb"}}}, + default_template = {"tmdb_person": "<>", "plex_search": {"all": {auto_type: "tmdb"}}} elif auto_type == "trakt_user_lists": dynamic_data = util.parse("Config", "data", dynamic, parent=map_name, methods=methods, datatype="list") for option in dynamic_data: