|
|
@ -746,7 +746,7 @@ class Plex:
|
|
|
|
return False
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
|
|
def edit_tags(self, attr, obj, add_tags=None, remove_tags=None, sync_tags=None):
|
|
|
|
def edit_tags(self, attr, obj, add_tags=None, remove_tags=None, sync_tags=None):
|
|
|
|
updated = False
|
|
|
|
display = ""
|
|
|
|
key = builder.filter_translation[attr] if attr in builder.filter_translation else attr
|
|
|
|
key = builder.filter_translation[attr] if attr in builder.filter_translation else attr
|
|
|
|
if add_tags or remove_tags or sync_tags:
|
|
|
|
if add_tags or remove_tags or sync_tags:
|
|
|
|
_add_tags = add_tags if add_tags else []
|
|
|
|
_add_tags = add_tags if add_tags else []
|
|
|
@ -760,14 +760,14 @@ class Plex:
|
|
|
|
_add = [f"{t[:1].upper()}{t[1:]}" for t in _add_tags + _sync_tags if t.lower() not in _item_tags]
|
|
|
|
_add = [f"{t[:1].upper()}{t[1:]}" for t in _add_tags + _sync_tags if t.lower() not in _item_tags]
|
|
|
|
_remove = [t for t in _item_tags if (_sync_tags and t not in _sync_tags) or t in _remove_tags]
|
|
|
|
_remove = [t for t in _item_tags if (_sync_tags and t not in _sync_tags) or t in _remove_tags]
|
|
|
|
if _add:
|
|
|
|
if _add:
|
|
|
|
updated = True
|
|
|
|
|
|
|
|
self.query_data(getattr(obj, f"add{attr.capitalize()}"), _add)
|
|
|
|
self.query_data(getattr(obj, f"add{attr.capitalize()}"), _add)
|
|
|
|
logger.info(f"Detail: {attr.capitalize()} {','.join(_add)} added to {obj.title}")
|
|
|
|
display += f"+{', +'.join(_add)}"
|
|
|
|
if _remove:
|
|
|
|
if _remove:
|
|
|
|
updated = True
|
|
|
|
|
|
|
|
self.query_data(getattr(obj, f"remove{attr.capitalize()}"), _remove)
|
|
|
|
self.query_data(getattr(obj, f"remove{attr.capitalize()}"), _remove)
|
|
|
|
logger.info(f"Detail: {attr.capitalize()} {','.join(_remove)} removed to {obj.title}")
|
|
|
|
display += f"-{', -'.join(_remove)}"
|
|
|
|
return updated
|
|
|
|
if len(display) > 0:
|
|
|
|
|
|
|
|
logger.info(f"{obj.title[:25]:<25} | {attr.capitalize()} | {display}")
|
|
|
|
|
|
|
|
return len(display) > 0
|
|
|
|
|
|
|
|
|
|
|
|
def update_item_from_assets(self, item, overlay=None, create=False):
|
|
|
|
def update_item_from_assets(self, item, overlay=None, create=False):
|
|
|
|
name = os.path.basename(os.path.dirname(str(item.locations[0])) if self.is_movie else str(item.locations[0]))
|
|
|
|
name = os.path.basename(os.path.dirname(str(item.locations[0])) if self.is_movie else str(item.locations[0]))
|
|
|
|