mirror of
https://github.com/meisnate12/Plex-Meta-Manager
synced 2024-11-10 06:54:21 +00:00
[25] move timings
This commit is contained in:
parent
cae5bf95b9
commit
0b1ca97403
2 changed files with 8 additions and 7 deletions
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
1.16.5-develop24
|
1.16.5-develop25
|
||||||
|
|
|
@ -170,11 +170,13 @@ class Overlays:
|
||||||
overlay_change = True
|
overlay_change = True
|
||||||
|
|
||||||
clean_name, _ = util.validate_filename(item.title)
|
clean_name, _ = util.validate_filename(item.title)
|
||||||
|
util.check_time("Initial Bit")
|
||||||
poster, _, item_dir = self.library.find_assets(
|
poster, _, item_dir = self.library.find_assets(
|
||||||
name="poster" if self.library.asset_folders else clean_name,
|
name="poster" if self.library.asset_folders else clean_name,
|
||||||
folder_name=clean_name if self.library.asset_folders else None,
|
folder_name=clean_name if self.library.asset_folders else None,
|
||||||
prefix=f"{item.title}'s "
|
prefix=f"{item.title}'s "
|
||||||
)
|
)
|
||||||
|
util.check_time("Find Asset Time")
|
||||||
|
|
||||||
has_original = None
|
has_original = None
|
||||||
changed_image = False
|
changed_image = False
|
||||||
|
@ -182,19 +184,22 @@ class Overlays:
|
||||||
if poster:
|
if poster:
|
||||||
if image_compare and str(poster.compare) != str(image_compare):
|
if image_compare and str(poster.compare) != str(image_compare):
|
||||||
changed_image = True
|
changed_image = True
|
||||||
|
util.check_time("Choose Image (From Assets) Time")
|
||||||
elif has_overlay:
|
elif has_overlay:
|
||||||
|
test = "Backup"
|
||||||
if os.path.exists(os.path.join(self.library.overlay_backup, f"{item.ratingKey}.png")):
|
if os.path.exists(os.path.join(self.library.overlay_backup, f"{item.ratingKey}.png")):
|
||||||
has_original = os.path.join(self.library.overlay_backup, f"{item.ratingKey}.png")
|
has_original = os.path.join(self.library.overlay_backup, f"{item.ratingKey}.png")
|
||||||
elif os.path.exists(os.path.join(self.library.overlay_backup, f"{item.ratingKey}.jpg")):
|
elif os.path.exists(os.path.join(self.library.overlay_backup, f"{item.ratingKey}.jpg")):
|
||||||
has_original = os.path.join(self.library.overlay_backup, f"{item.ratingKey}.jpg")
|
has_original = os.path.join(self.library.overlay_backup, f"{item.ratingKey}.jpg")
|
||||||
else:
|
else:
|
||||||
self.library.reload(item)
|
test = "Online"
|
||||||
new_backup = find_poster_url(item)
|
new_backup = find_poster_url(item)
|
||||||
if new_backup is None:
|
if new_backup is None:
|
||||||
new_backup = item.posterUrl
|
new_backup = item.posterUrl
|
||||||
|
util.check_time(f"Choose Image (From {test}) Time")
|
||||||
else:
|
else:
|
||||||
self.library.reload(item)
|
|
||||||
new_backup = item.posterUrl
|
new_backup = item.posterUrl
|
||||||
|
util.check_time("Choose Image (From Plex) Time")
|
||||||
if new_backup:
|
if new_backup:
|
||||||
changed_image = True
|
changed_image = True
|
||||||
image_response = self.config.get(new_backup)
|
image_response = self.config.get(new_backup)
|
||||||
|
@ -230,13 +235,9 @@ class Overlays:
|
||||||
new_poster = new_poster.resize(overlay_images[over_name].size, Image.ANTIALIAS)
|
new_poster = new_poster.resize(overlay_images[over_name].size, Image.ANTIALIAS)
|
||||||
new_poster.paste(overlay_images[over_name], (0, 0), overlay_images[over_name])
|
new_poster.paste(overlay_images[over_name], (0, 0), overlay_images[over_name])
|
||||||
new_poster.save(temp, "PNG")
|
new_poster.save(temp, "PNG")
|
||||||
util.check_time("Overlay and Save Image Time")
|
|
||||||
self.library.upload_poster(item, temp)
|
self.library.upload_poster(item, temp)
|
||||||
util.check_time("Upload Image Time")
|
|
||||||
self.library.edit_tags("label", item, add_tags=["Overlay"], do_print=False)
|
self.library.edit_tags("label", item, add_tags=["Overlay"], do_print=False)
|
||||||
util.check_time("Edit Tag Time")
|
|
||||||
self.library.reload(item)
|
self.library.reload(item)
|
||||||
util.check_time("Reload Time")
|
|
||||||
poster_compare = poster.compare if poster else item.thumb
|
poster_compare = poster.compare if poster else item.thumb
|
||||||
logger.info(f"Detail: Overlays: {', '.join(over_names)} applied to {item.title}")
|
logger.info(f"Detail: Overlays: {', '.join(over_names)} applied to {item.title}")
|
||||||
except (OSError, BadRequest) as e:
|
except (OSError, BadRequest) as e:
|
||||||
|
|
Loading…
Reference in a new issue