[27] label pmm managed collections

pull/921/head
meisnate12 3 years ago
parent 87eab7251b
commit f0d814a146

@ -1 +1 @@
1.17.0-develop26
1.17.0-develop27

@ -2434,9 +2434,13 @@ class CollectionBuilder:
self.obj.editContentRating(self.details["content_rating"])
batch_display += f"\nContent Rating | {self.details['content_rating']}"
add_tags = self.details["label"] if "label" in self.details else None
add_tags = self.details["label"] if "label" in self.details else []
remove_tags = self.details["label.remove"] if "label.remove" in self.details else None
sync_tags = self.details["label.sync"] if "label.sync" in self.details else None
if sync_tags:
sync_tags.append("PMM")
else:
add_tags.append("PMM")
tag_results = self.library.edit_tags('label', self.obj, add_tags=add_tags, remove_tags=remove_tags, sync_tags=sync_tags, do_print=False)[28:]
if tag_results:
batch_display += f"\n{tag_results}"

@ -360,11 +360,12 @@ class Operations:
logger.info("")
unmanaged_collections = []
for col in self.library.get_all_collections():
labels = [la.tag for la in self.library.item_labels(col)]
if (self.library.delete_collections_with_less and col.childCount < self.library.delete_collections_with_less) \
or (self.library.delete_unmanaged_collections and col.title not in self.library.collections):
or (self.library.delete_unmanaged_collections and "PMM" not in labels):
self.library.query(col.delete)
logger.info(f"{col.title} Deleted")
elif col.title not in self.library.collections:
elif "PMM" not in labels:
unmanaged_collections.append(col)
if self.library.show_unmanaged and len(unmanaged_collections) > 0:

Loading…
Cancel
Save