[8] fix episode rating update

pull/960/head
meisnate12 2 years ago
parent a0655e16c1
commit e392f007cd

@ -1 +1 @@
1.17.1-develop7 1.17.1-develop8

@ -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] [type this into your terminal]
``` ```
nano "config\Movies.yml" nano "config/Movies.yml"
``` ```
</details> </details>

@ -345,6 +345,7 @@ class Operations:
for ep in item.episodes(): for ep in item.episodes():
ep.batchEdits() ep.batchEdits()
batch_display = ""
item_title = self.library.get_item_sort_title(ep, atr="title") item_title = self.library.get_item_sort_title(ep, atr="title")
def get_episode_rating(attribute): def get_episode_rating(attribute):
@ -365,7 +366,7 @@ class Operations:
logger.info(f"{item_title[:25]:<25} | No Rating Found") logger.info(f"{item_title[:25]:<25} | No Rating Found")
elif str(ep.audienceRating) != str(new_rating): elif str(ep.audienceRating) != str(new_rating):
ep.editField("audienceRating", 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: except Failed:
pass pass
@ -376,7 +377,7 @@ class Operations:
logger.info(f"{item_title[:25]:<25} | No Rating Found") logger.info(f"{item_title[:25]:<25} | No Rating Found")
elif str(ep.rating) != str(new_rating): elif str(ep.rating) != str(new_rating):
ep.editField("rating", 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: except Failed:
pass pass
@ -387,10 +388,14 @@ class Operations:
logger.info(f"{item_title[:25]:<25} | No Rating Found") logger.info(f"{item_title[:25]:<25} | No Rating Found")
elif str(ep.userRating) != str(new_rating): elif str(ep.userRating) != str(new_rating):
ep.editField("userRating", 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: except Failed:
pass 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: if self.library.Radarr and self.library.radarr_add_all_existing:
try: try:
self.library.Radarr.add_tmdb(radarr_adds) self.library.Radarr.add_tmdb(radarr_adds)

Loading…
Cancel
Save