@ -354,6 +354,8 @@ class CollectionBuilder:
" changes_webhooks " : self . library . changes_webhooks ,
" changes_webhooks " : self . library . changes_webhooks ,
" cache_builders " : 0
" cache_builders " : 0
}
}
if self . library . mass_collection_mode :
self . details [ " collection_mode " ] = self . library . mass_collection_mode
self . item_details = { }
self . item_details = { }
self . radarr_details = { }
self . radarr_details = { }
self . sonarr_details = { }
self . sonarr_details = { }
@ -885,10 +887,10 @@ class CollectionBuilder:
elif method_name == " tmdb_region " :
elif method_name == " tmdb_region " :
self . tmdb_region = util . parse ( self . Type , method_name , method_data , options = self . config . TMDb . iso_3166_1 )
self . tmdb_region = util . parse ( self . Type , method_name , method_data , options = self . config . TMDb . iso_3166_1 )
elif method_name == " collection_mode " :
elif method_name == " collection_mode " :
if method_data and str ( method_data ) . lower ( ) in plex . collection_mode_options :
try :
self . details [ method_name ] = plex. collection_mode_options [ str ( method_data ) . lower ( ) ]
self . details [ method_name ] = util. check_collection_mode ( method_data )
e lse:
e xcept Fai led a s e:
logger . error ( f " Config Error: { m ethod_data} collection_mode invalid \n \t default (Library default) \n \t hide (Hide Collection) \n \t hide_items (Hide Items in this Collection) \n \t show_items (Show this Collection and its Items) " )
logger . error ( e)
elif method_name == " collection_filtering " :
elif method_name == " collection_filtering " :
if method_data and str ( method_data ) . lower ( ) in plex . collection_filtering_options :
if method_data and str ( method_data ) . lower ( ) in plex . collection_filtering_options :
self . details [ method_name ] = str ( method_data ) . lower ( )
self . details [ method_name ] = str ( method_data ) . lower ( )
@ -2023,7 +2025,6 @@ class CollectionBuilder:
total = len ( items )
total = len ( items )
spacing = len ( str ( total ) ) * 2 + 1
spacing = len ( str ( total ) ) * 2 + 1
for i , item in enumerate ( items , 1 ) :
for i , item in enumerate ( items , 1 ) :
self . library . reload ( item )
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 ) } " )
if self . playlist :
if self . playlist :
@ -2409,15 +2410,15 @@ class CollectionBuilder:
path = path . replace ( self . library . Sonarr . plex_path , self . library . Sonarr . sonarr_path )
path = path . replace ( self . library . Sonarr . plex_path , self . library . Sonarr . sonarr_path )
path = path [ : - 1 ] if path . endswith ( ( ' / ' , ' \\ ' ) ) else path
path = path [ : - 1 ] if path . endswith ( ( ' / ' , ' \\ ' ) ) else path
tvdb_paths . append ( ( self . library . show_rating_key_map [ item . ratingKey ] , path ) )
tvdb_paths . append ( ( self . library . show_rating_key_map [ item . ratingKey ] , path ) )
advance_edits = { }
if any ( [ mn in plex . item_advance_keys for mn in self . item_details ] ) and hasattr ( item , " preferences " ) :
if hasattr ( item , " preferences " ) :
advance_edits = { }
prefs = [ p . id for p in item . preferences ( ) ]
prefs = [ p . id for p in item . preferences ( ) ]
for method_name , method_data in self . item_details . items ( ) :
for method_name , method_data in self . item_details . items ( ) :
if method_name in plex . item_advance_keys :
if method_name in plex . item_advance_keys :
key , options = plex . item_advance_keys [ method_name ]
key , options = plex . item_advance_keys [ method_name ]
if key in prefs and getattr ( item , key ) != options [ method_data ] :
if key in prefs and getattr ( item , key ) != options [ method_data ] :
advance_edits [ key ] = options [ method_data ]
advance_edits [ key ] = options [ method_data ]
self . library . edit_item ( item , item . title , self . collection_level . capitalize ( ) , advance_edits , advanced = True )
self . library . edit_item ( item , item . title , self . collection_level . capitalize ( ) , advance_edits , advanced = True )
if " item_tmdb_season_titles " in self . item_details and item . ratingKey in self . library . show_rating_key_map :
if " item_tmdb_season_titles " in self . item_details and item . ratingKey in self . library . show_rating_key_map :
try :
try :