@ -339,29 +339,6 @@ class CollectionBuilder:
else :
else :
self . sync = self . data [ methods [ " sync_mode " ] ] . lower ( ) == " sync "
self . sync = self . data [ methods [ " sync_mode " ] ] . lower ( ) == " sync "
test_sort = None
if " collection_order " in methods and not self . playlist :
if self . data [ methods [ " collection_order " ] ] is None :
raise Failed ( f " { self . Type } Warning: collection_order attribute is blank " )
else :
test_sort = self . data [ methods [ " collection_order " ] ]
elif " collection_order " not in methods and not self . playlist and self . library . default_collection_order :
test_sort = self . library . default_collection_order
logger . warning ( f " { self . Type } Warning: collection_order not found using library default_collection_order: { self . library . default_collection_order } " )
self . custom_sort = self . playlist
if test_sort :
logger . debug ( " " )
logger . debug ( " Validating Method: collection_order " )
logger . debug ( f " Value: { test_sort } " )
if test_sort . lower ( ) in plex . collection_order_options :
self . details [ " collection_order " ] = test_sort . lower ( )
if test_sort . lower ( ) == " custom " and self . build_collection :
self . custom_sort = True
elif ( self . library . is_movie and test_sort . lower ( ) in plex . movie_sorts ) or ( self . library . is_show and test_sort . lower ( ) in plex . show_sorts ) :
self . custom_sort = test_sort . lower ( )
else :
raise Failed ( f " { self . Type } Error: { test_sort } collection_order invalid \n \t release (Order Collection by release dates) \n \t alpha (Order Collection Alphabetically) \n \t custom (Custom Order Collection) \n \t Other sorting options can be found at https://github.com/meisnate12/Plex-Meta-Manager/wiki/Smart-Builders#sort-options " )
self . collection_level = " movie " if self . library . is_movie else " show "
self . collection_level = " movie " if self . library . is_movie else " show "
if self . playlist :
if self . playlist :
self . collection_level = " item "
self . collection_level = " item "
@ -459,24 +436,30 @@ class CollectionBuilder:
self . smart = self . smart_url or self . smart_label_collection
self . smart = self . smart_url or self . smart_label_collection
self . custom_sort = self . playlist
test_sort = None
if " collection_order " in methods and not self . playlist :
if " collection_order " in methods and not self . playlist :
if self . data [ methods [ " collection_order " ] ] is None :
raise Failed ( f " { self . Type } Warning: collection_order attribute is blank " )
else :
test_sort = self . data [ methods [ " collection_order " ] ]
elif " collection_order " not in methods and not self . playlist and self . library . default_collection_order :
test_sort = self . library . default_collection_order
logger . warning ( f " { self . Type } Warning: collection_order not found using library default_collection_order: { self . library . default_collection_order } " )
self . custom_sort = self . playlist
if test_sort :
if self . smart :
if self . smart :
raise Failed ( f " { self . Type } Error: collection_order does not work with Smart Collections " )
raise Failed ( f " { self . Type } Error: collection_order does not work with Smart Collections " )
logger . debug ( " " )
logger . debug ( " " )
logger . debug ( " Validating Method: collection_order " )
logger . debug ( " Validating Method: collection_order " )
if self . data [ methods [ " collection_order " ] ] is None :
logger . debug ( f " Value: { test_sort } " )
raise Failed ( f " { self . Type } Error: collection_order attribute is blank " )
if test_sort . lower ( ) in plex . collection_order_options :
self . details [ " collection_order " ] = test_sort . lower ( )
if test_sort . lower ( ) == " custom " and self . build_collection :
self . custom_sort = True
elif ( self . library . is_movie and test_sort . lower ( ) in plex . movie_sorts ) or ( self . library . is_show and test_sort . lower ( ) in plex . show_sorts ) :
self . custom_sort = test_sort . lower ( )
else :
else :
logger . debug ( f " Value: { self . data [ methods [ ' collection_order ' ] ] } " )
raise Failed ( f " { self . Type } Error: { test_sort } collection_order invalid \n \t release (Order Collection by release dates) \n \t alpha (Order Collection Alphabetically) \n \t custom (Custom Order Collection) \n \t Other sorting options can be found at https://github.com/meisnate12/Plex-Meta-Manager/wiki/Smart-Builders#sort-options " )
if self . data [ methods [ " collection_order " ] ] . lower ( ) in plex . collection_order_options :
self . details [ " collection_order " ] = self . data [ methods [ " collection_order " ] ] . lower ( )
if self . data [ methods [ " collection_order " ] ] . lower ( ) == " custom " and self . build_collection :
self . custom_sort = True
elif ( self . library . is_movie and self . data [ methods [ " collection_order " ] ] . lower ( ) in plex . movie_sorts ) or ( self . library . is_show and self . data [ methods [ " collection_order " ] ] . lower ( ) in plex . show_sorts ) :
self . custom_sort = self . data [ methods [ " collection_order " ] ] . lower ( )
else :
raise Failed ( f " { self . Type } Error: { self . data [ methods [ ' collection_order ' ] ] } collection_order invalid \n \t release (Order Collection by release dates) \n \t alpha (Order Collection Alphabetically) \n \t custom (Custom Order Collection) \n \t Other sorting options can be found at https://github.com/meisnate12/Plex-Meta-Manager/wiki/Smart-Builders#sort-options " )
if self . smart_url or self . smart_label_collection or self . parts_collection :
if self . smart_url or self . smart_label_collection or self . parts_collection :
self . custom_sort = False
self . custom_sort = False