From e392f007cdc6cc97fb82042303cd25fcf9275290 Mon Sep 17 00:00:00 2001 From: meisnate12 Date: Tue, 5 Jul 2022 02:11:21 -0400 Subject: [PATCH] [8] fix episode rating update --- VERSION | 2 +- docs/home/guides/local.md | 2 +- modules/operations.py | 11 ++++++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index 5aca0cb7..4f0234d1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.17.1-develop7 +1.17.1-develop8 diff --git a/docs/home/guides/local.md b/docs/home/guides/local.md index dbaf263b..106352dc 100644 --- a/docs/home/guides/local.md +++ b/docs/home/guides/local.md @@ -656,7 +656,7 @@ First, open the metadata file [this will create the file if it doesn't already e [type this into your terminal] ``` - nano "config\Movies.yml" + nano "config/Movies.yml" ``` diff --git a/modules/operations.py b/modules/operations.py index 556db6b6..f778f6b3 100644 --- a/modules/operations.py +++ b/modules/operations.py @@ -345,6 +345,7 @@ class Operations: for ep in item.episodes(): ep.batchEdits() + batch_display = "" item_title = self.library.get_item_sort_title(ep, atr="title") def get_episode_rating(attribute): @@ -365,7 +366,7 @@ class Operations: logger.info(f"{item_title[:25]:<25} | No Rating Found") elif str(ep.audienceRating) != str(new_rating): ep.editField("audienceRating", new_rating) - logger.info(f"\n{item_title[:25]:<25} | Audience Rating | {new_rating}") + batch_display += f"\n{item_title[:25]:<25} | Audience Rating | {new_rating}" except Failed: pass @@ -376,7 +377,7 @@ class Operations: logger.info(f"{item_title[:25]:<25} | No Rating Found") elif str(ep.rating) != str(new_rating): ep.editField("rating", new_rating) - logger.info(f"{item_title[:25]:<25} | Critic Rating | {new_rating}") + batch_display += f"\n{item_title[:25]:<25} | Critic Rating | {new_rating}" except Failed: pass @@ -387,10 +388,14 @@ class Operations: logger.info(f"{item_title[:25]:<25} | No Rating Found") elif str(ep.userRating) != str(new_rating): ep.editField("userRating", new_rating) - logger.info(f"{item_title[:25]:<25} | User Rating | {new_rating}") + batch_display += f"\n{item_title[:25]:<25} | User Rating | {new_rating}" except Failed: pass + item.saveEdits() + if len(batch_display) > 0: + logger.info(f"Batch Edits{batch_display}") + if self.library.Radarr and self.library.radarr_add_all_existing: try: self.library.Radarr.add_tmdb(radarr_adds)