pull/692/head
meisnate12 3 years ago
parent 134a1551ab
commit 8b82d7e552

@ -1 +1 @@
1.15.1-develop45
1.15.1-develop46

@ -355,8 +355,12 @@ class MetadataFile(DataFile):
remove_prefix = util.parse("Config", "remove_prefix", dynamic, parent=map_name, methods=methods, datatype="commalist") if "remove_prefix" in methods else []
remove_suffix = util.parse("Config", "remove_suffix", dynamic, parent=map_name, methods=methods, datatype="commalist") if "remove_suffix" in methods else []
sync = {i.title: i for i in self.library.search(libtype="collection", label=str(map_name))} if sync else {}
other_name = util.parse("Config", "other", dynamic, parent=map_name, methods=methods) if "other" in methods else None
other_keys = []
for key, value in auto_list.items():
if include and key not in include:
if key not in exclude:
other_keys.append(key)
continue
template_call = {"name": template_name, auto_type: [key] + addons[key] if key in addons else key}
for k, v in dictionary_variables.items():
@ -381,6 +385,13 @@ class MetadataFile(DataFile):
if collection_title in sync:
sync.pop(collection_title)
self.collections[collection_title] = col
if other_name:
col = {"template": {"name": template_name, auto_type: other_keys}, "label": str(map_name)}
if test:
col["test"] = True
if other_name in sync:
sync.pop(other_name)
self.collections[other_name] = col
for col_title, col in sync.items():
col.delete()
logger.info(f"{map_name} Dynamic Collection: {col_title} Deleted")

@ -448,7 +448,11 @@ class Plex(Library):
def fetchItem(self, data):
return self.PlexServer.fetchItem(data)
def get_all(self, collection_level=None):
def get_all(self, collection_level=None, load=False):
if load and not collection_level:
self._all_items = []
if self._all_items and not collection_level:
return self._all_items
collection_type = collection_level if collection_level else self.Plex.TYPE
if not collection_level:
collection_level = self.type

@ -458,7 +458,7 @@ def library_operations(config, library):
tmdb_collections = {}
if library.items_library_operation:
items = library.get_all()
items = library.get_all(load=True)
radarr_adds = []
sonarr_adds = []
trakt_ratings = config.Trakt.user_ratings(library.is_movie) if library.mass_trakt_rating_update else []
@ -700,7 +700,7 @@ def library_operations(config, library):
logger.info(f"Metadata Backup Path: {library.metadata_backup['path']}")
logger.info("")
meta = {}
items = library.get_all()
items = library.get_all(load=True)
titles = [i.title for i in items]
for i, item in enumerate(items, 1):
util.print_return(f"Processing: {i}/{len(items)} {item.title}")

Loading…
Cancel
Save