|
|
@ -288,10 +288,12 @@ class CollectionBuilder:
|
|
|
|
self.notification_additions = []
|
|
|
|
self.notification_additions = []
|
|
|
|
self.notification_removals = []
|
|
|
|
self.notification_removals = []
|
|
|
|
self.items = []
|
|
|
|
self.items = []
|
|
|
|
|
|
|
|
self.remove_item_map = {}
|
|
|
|
self.posters = {}
|
|
|
|
self.posters = {}
|
|
|
|
self.backgrounds = {}
|
|
|
|
self.backgrounds = {}
|
|
|
|
self.summaries = {}
|
|
|
|
self.summaries = {}
|
|
|
|
self.schedule = ""
|
|
|
|
self.schedule = ""
|
|
|
|
|
|
|
|
self.beginning_count = 0
|
|
|
|
self.minimum = self.library.minimum_items
|
|
|
|
self.minimum = self.library.minimum_items
|
|
|
|
self.ignore_ids = [i for i in self.library.ignore_ids]
|
|
|
|
self.ignore_ids = [i for i in self.library.ignore_ids]
|
|
|
|
self.ignore_imdb_ids = [i for i in self.library.ignore_imdb_ids]
|
|
|
|
self.ignore_imdb_ids = [i for i in self.library.ignore_imdb_ids]
|
|
|
@ -689,12 +691,11 @@ class CollectionBuilder:
|
|
|
|
except Failed:
|
|
|
|
except Failed:
|
|
|
|
self.obj = None
|
|
|
|
self.obj = None
|
|
|
|
|
|
|
|
|
|
|
|
self.plex_map = {}
|
|
|
|
|
|
|
|
if self.sync and self.obj:
|
|
|
|
|
|
|
|
for item in self.library.get_collection_items(self.obj, self.smart_label_collection):
|
|
|
|
|
|
|
|
self.plex_map[item.ratingKey] = item
|
|
|
|
|
|
|
|
if self.obj:
|
|
|
|
if self.obj:
|
|
|
|
self.exists = True
|
|
|
|
self.exists = True
|
|
|
|
|
|
|
|
self.beginning_count = self.obj.childCount
|
|
|
|
|
|
|
|
if self.sync:
|
|
|
|
|
|
|
|
self.remove_item_map = {i.ratingKey: i for i in self.library.get_collection_items(self.obj, self.smart_label_collection)}
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
self.obj = None
|
|
|
|
self.obj = None
|
|
|
|
self.sync = False
|
|
|
|
self.sync = False
|
|
|
@ -1780,7 +1781,7 @@ class CollectionBuilder:
|
|
|
|
number_text = f"{i}/{total}"
|
|
|
|
number_text = f"{i}/{total}"
|
|
|
|
logger.info(util.adjust_space(f"{number_text:>{spacing}} | {name} {self.Type} | {current_operation} | {util.item_title(item)}"))
|
|
|
|
logger.info(util.adjust_space(f"{number_text:>{spacing}} | {name} {self.Type} | {current_operation} | {util.item_title(item)}"))
|
|
|
|
if item in collection_items:
|
|
|
|
if item in collection_items:
|
|
|
|
self.plex_map[item.ratingKey] = None
|
|
|
|
self.remove_item_map[item.ratingKey] = None
|
|
|
|
amount_unchanged += 1
|
|
|
|
amount_unchanged += 1
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
if self.playlist:
|
|
|
|
if self.playlist:
|
|
|
@ -1810,7 +1811,7 @@ class CollectionBuilder:
|
|
|
|
def sync_collection(self):
|
|
|
|
def sync_collection(self):
|
|
|
|
amount_removed = 0
|
|
|
|
amount_removed = 0
|
|
|
|
playlist_removes = []
|
|
|
|
playlist_removes = []
|
|
|
|
items = [item for _, item in self.plex_map.items() if item is not None]
|
|
|
|
items = [item for _, item in self.remove_item_map.items() if item is not None]
|
|
|
|
if items:
|
|
|
|
if items:
|
|
|
|
logger.info("")
|
|
|
|
logger.info("")
|
|
|
|
util.separator(f"Removed from {self.name} {self.Type}", space=False, border=False)
|
|
|
|
util.separator(f"Removed from {self.name} {self.Type}", space=False, border=False)
|
|
|
|