mirror of
https://github.com/meisnate12/Plex-Meta-Manager
synced 2024-11-10 06:54:21 +00:00
run custom sorts at the end of a library run
This commit is contained in:
parent
98d1146e61
commit
26eb57587f
2 changed files with 15 additions and 4 deletions
|
@ -300,6 +300,7 @@ class Plex:
|
|||
self.movie_rating_key_map = {}
|
||||
self.show_rating_key_map = {}
|
||||
self.run_again = []
|
||||
self.run_sort = []
|
||||
self.overlays = []
|
||||
|
||||
def get_all_collections(self):
|
||||
|
|
|
@ -169,6 +169,15 @@ def update_libraries(config):
|
|||
logger.removeHandler(library_handler)
|
||||
run_collection(config, library, metadata, collections_to_run)
|
||||
logger.addHandler(library_handler)
|
||||
if library.run_sort:
|
||||
logger.info("")
|
||||
util.separator(f"Sorting {library.name} Library's Collections", space=False, border=False)
|
||||
logger.info("")
|
||||
for builder in library.run_sort:
|
||||
logger.info("")
|
||||
util.separator(f"Sorting {builder.name} Collection", space=False, border=False)
|
||||
logger.info("")
|
||||
builder.sort_collection()
|
||||
|
||||
if not config.test_mode and not config.requested_collections and ((library.show_unmanaged and not library_only) or (library.assets_for_all and not collection_only)):
|
||||
logger.info("")
|
||||
|
@ -515,10 +524,11 @@ def run_collection(config, library, metadata, requested_collections):
|
|||
builder.update_details()
|
||||
|
||||
if builder.custom_sort:
|
||||
logger.info("")
|
||||
util.separator(f"Sorting {mapping_name} Collection", space=False, border=False)
|
||||
logger.info("")
|
||||
builder.sort_collection()
|
||||
library.run_sort.append(builder)
|
||||
# logger.info("")
|
||||
# util.separator(f"Sorting {mapping_name} Collection", space=False, border=False)
|
||||
# logger.info("")
|
||||
# builder.sort_collection()
|
||||
|
||||
builder.update_item_details()
|
||||
|
||||
|
|
Loading…
Reference in a new issue