|
|
@ -2526,6 +2526,8 @@ class CollectionBuilder:
|
|
|
|
amount_unchanged += 1
|
|
|
|
amount_unchanged += 1
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
items_added.append(item)
|
|
|
|
items_added.append(item)
|
|
|
|
|
|
|
|
if not self.playlist: # Delete TODO: BATCH COLLECTIONS
|
|
|
|
|
|
|
|
self.library.alter_collection(item, name, smart_label_collection=self.smart_label_collection) # Delete TODO: BATCH COLLECTIONS
|
|
|
|
amount_added += 1
|
|
|
|
amount_added += 1
|
|
|
|
if self.details["changes_webhooks"]:
|
|
|
|
if self.details["changes_webhooks"]:
|
|
|
|
self.notification_additions.append(util.item_set(item, self.library.get_id_from_maps(item.ratingKey)))
|
|
|
|
self.notification_additions.append(util.item_set(item, self.library.get_id_from_maps(item.ratingKey)))
|
|
|
@ -2535,8 +2537,8 @@ class CollectionBuilder:
|
|
|
|
logger.info(f"Playlist: {self.name} created")
|
|
|
|
logger.info(f"Playlist: {self.name} created")
|
|
|
|
elif self.playlist and items_added:
|
|
|
|
elif self.playlist and items_added:
|
|
|
|
self.obj.addItems(items_added)
|
|
|
|
self.obj.addItems(items_added)
|
|
|
|
elif items_added:
|
|
|
|
#elif items_added: # Uncomment TODO: BATCH COLLECTIONS
|
|
|
|
self.library.alter_collection(items_added, name, smart_label_collection=self.smart_label_collection)
|
|
|
|
# self.library.alter_collection(items_added, name, smart_label_collection=self.smart_label_collection) # Uncomment TODO: BATCH COLLECTIONS
|
|
|
|
if self.do_report and items_added:
|
|
|
|
if self.do_report and items_added:
|
|
|
|
self.library.add_additions(self.name, [(i.title, self.library.get_id_from_maps(i.ratingKey)) for i in items_added], self.library.is_movie)
|
|
|
|
self.library.add_additions(self.name, [(i.title, self.library.get_id_from_maps(i.ratingKey)) for i in items_added], self.library.is_movie)
|
|
|
|
logger.exorcise()
|
|
|
|
logger.exorcise()
|
|
|
@ -2559,14 +2561,16 @@ class CollectionBuilder:
|
|
|
|
number_text = f"{i}/{total}"
|
|
|
|
number_text = f"{i}/{total}"
|
|
|
|
logger.info(f"{number_text:>{spacing}} | {self.name} {self.Type} | - | {util.item_title(item)}")
|
|
|
|
logger.info(f"{number_text:>{spacing}} | {self.name} {self.Type} | - | {util.item_title(item)}")
|
|
|
|
items_removed.append(item)
|
|
|
|
items_removed.append(item)
|
|
|
|
|
|
|
|
if not self.playlist: # Delete TODO: BATCH COLLECTIONS
|
|
|
|
|
|
|
|
self.library.alter_collection(item, self.name, smart_label_collection=self.smart_label_collection, add=False) # Delete TODO: BATCH COLLECTIONS
|
|
|
|
amount_removed += 1
|
|
|
|
amount_removed += 1
|
|
|
|
if self.details["changes_webhooks"]:
|
|
|
|
if self.details["changes_webhooks"]:
|
|
|
|
self.notification_removals.append(util.item_set(item, self.library.get_id_from_maps(item.ratingKey)))
|
|
|
|
self.notification_removals.append(util.item_set(item, self.library.get_id_from_maps(item.ratingKey)))
|
|
|
|
if self.playlist and items_removed:
|
|
|
|
if self.playlist and items_removed:
|
|
|
|
self.library._reload(self.obj)
|
|
|
|
self.library._reload(self.obj)
|
|
|
|
self.obj.removeItems(items_removed)
|
|
|
|
self.obj.removeItems(items_removed)
|
|
|
|
elif items_removed:
|
|
|
|
#elif items_removed: # Uncomment TODO: BATCH COLLECTIONS
|
|
|
|
self.library.alter_collection(items_removed, self.name, smart_label_collection=self.smart_label_collection, add=False)
|
|
|
|
# self.library.alter_collection(items_removed, self.name, smart_label_collection=self.smart_label_collection, add=False) # Uncomment TODO: BATCH COLLECTIONS
|
|
|
|
if self.do_report and items_removed:
|
|
|
|
if self.do_report and items_removed:
|
|
|
|
self.library.add_removed(self.name, [(i.title, self.library.get_id_from_maps(i.ratingKey)) for i in items_removed], self.library.is_movie)
|
|
|
|
self.library.add_removed(self.name, [(i.title, self.library.get_id_from_maps(i.ratingKey)) for i in items_removed], self.library.is_movie)
|
|
|
|
logger.info("")
|
|
|
|
logger.info("")
|
|
|
|