Skip to content

Commit

Permalink
Merge pull request #333 from meisnate12/develop
Browse files Browse the repository at this point in the history
v1.11.3
  • Loading branch information
meisnate12 authored Jul 12, 2021
2 parents f2e4d7a + 0527c0b commit 54876e9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
1 change: 1 addition & 0 deletions modules/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,7 @@ def get_int(parent, int_method, data_in, methods_in, default_in, minimum=1, maxi
for item in self.library.get_collection_items(self.obj, self.smart_label_collection):
self.plex_map[item.ratingKey] = item
else:
self.obj = None
self.sync = False
self.run_again = False
logger.info("")
Expand Down
29 changes: 14 additions & 15 deletions modules/plex.py
Original file line number Diff line number Diff line change
Expand Up @@ -750,23 +750,22 @@ def edit_tags(self, attr, obj, add_tags=None, remove_tags=None, sync_tags=None):
key = builder.filter_translation[attr] if attr in builder.filter_translation else attr
if add_tags or remove_tags or sync_tags:
_add_tags = add_tags if add_tags else []
_remove = [t.lower() for t in remove_tags] if remove_tags else []
_remove_tags = remove_tags if remove_tags else []
_sync_tags = sync_tags if sync_tags else []
_sync = [t.lower() for t in _sync_tags]
item_tags = [item_tag.tag.lower() for item_tag in getattr(obj, key)]
_add = _add_tags + _sync_tags
try:
_item_tags = [item_tag.tag.lower() for item_tag in getattr(obj, key)]
except BadRequest:
_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]
if _add:
add = [f"{t[:1].upper()}{t[1:]}" for t in _add if t.lower() not in item_tags]
if add:
updated = True
self.query_data(getattr(obj, f"add{attr.capitalize()}"), add)
logger.info(f"Detail: {attr.capitalize()} {add} added")
if _remove or _sync:
remove = [t for t in item_tags if t not in _sync or t in _remove]
if remove:
updated = True
self.query_data(getattr(obj, f"remove{attr.capitalize()}"), remove)
logger.info(f"Detail: {attr.capitalize()} {remove} removed")
updated = True
self.query_data(getattr(obj, f"add{attr.capitalize()}"), _add)
logger.info(f"Detail: {attr.capitalize()} {_add} added")
if _remove:
updated = True
self.query_data(getattr(obj, f"remove{attr.capitalize()}"), _remove)
logger.info(f"Detail: {attr.capitalize()} {_remove} removed")
return updated

def update_item_from_assets(self, item, overlay=None):
Expand Down
2 changes: 1 addition & 1 deletion plex_meta_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def start(config_path, is_test=False, time_scheduled=None, requested_collections
logger.info(util.centered("| __/| | __/> < | | | | __/ || (_| | | | | | (_| | | | | (_| | (_| | __/ | "))
logger.info(util.centered("|_| |_|\\___/_/\\_\\ |_| |_|\\___|\\__\\__,_| |_| |_|\\__,_|_| |_|\\__,_|\\__, |\\___|_| "))
logger.info(util.centered(" |___/ "))
logger.info(util.centered(" Version: 1.11.2 "))
logger.info(util.centered(" Version: 1.11.3 "))
if time_scheduled: start_type = f"{time_scheduled} "
elif is_test: start_type = "Test "
elif requested_collections: start_type = "Collections "
Expand Down

0 comments on commit 54876e9

Please sign in to comment.