[28] fix plex_collectionless

This commit is contained in:
meisnate12 2022-06-08 14:25:23 -04:00
parent f0d814a146
commit 93273cfda6
2 changed files with 5 additions and 5 deletions

View file

@ -1 +1 @@
1.17.0-develop27
1.17.0-develop28

View file

@ -794,22 +794,21 @@ class Plex(Library):
elif method == "plex_collectionless":
good_collections = []
logger.info(f"Processing Plex Collectionless")
logger.info("Collections Excluded")
logger.info("")
for col in self.get_all_collections():
keep_collection = True
for pre in data["exclude_prefix"]:
if col.title.startswith(pre) or (col.titleSort and col.titleSort.startswith(pre)):
keep_collection = False
logger.info(f"{col.title} excluded by prefix match {pre}")
logger.info(f"Excluded by Prefix Match: {col.title}")
break
if keep_collection:
for ext in data["exclude"]:
if col.title == ext or (col.titleSort and col.titleSort == ext):
keep_collection = False
logger.info(f"{col.title} excluded by exact match")
logger.info(f"Excluded by Exact Match: {col.title}")
break
if keep_collection:
logger.info(f"Collection Passed: {col.title}")
good_collections.append(col)
logger.info("")
logger.info("Collections Not Excluded (Items in these collections are not added to Collectionless)")
@ -819,6 +818,7 @@ class Plex(Library):
all_items = self.get_all()
for i, item in enumerate(all_items, 1):
logger.ghost(f"Processing: {i}/{len(all_items)} {item.title}")
self.reload(item)
add_item = True
for collection in item.collections:
if collection.id in collection_indexes: