@ -78,17 +78,14 @@ summary_details = [
]
]
poster_details = [ " url_poster " , " tmdb_poster " , " tmdb_profile " , " tvdb_poster " , " file_poster " ]
poster_details = [ " url_poster " , " tmdb_poster " , " tmdb_profile " , " tvdb_poster " , " file_poster " ]
background_details = [ " url_background " , " tmdb_background " , " tvdb_background " , " file_background " ]
background_details = [ " url_background " , " tmdb_background " , " tvdb_background " , " file_background " ]
boolean_details = [
boolean_details = [ " show_filtered " , " show_missing " , " save_missing " , " missing_only_released " , " only_filter_missing " , " delete_below_minimum " ]
" visible_library " , " visible_home " , " visible_shared " , " show_filtered " , " show_missing " , " save_missing " ,
" missing_only_released " , " only_filter_missing " , " delete_below_minimum "
]
string_details = [ " sort_title " , " content_rating " , " name_mapping " ]
string_details = [ " sort_title " , " content_rating " , " name_mapping " ]
ignored_details = [
ignored_details = [
" smart_filter " , " smart_label " , " smart_url " , " run_again " , " schedule " , " sync_mode " , " template " , " test " , " delete_not_scheduled " ,
" smart_filter " , " smart_label " , " smart_url " , " run_again " , " schedule " , " sync_mode " , " template " , " test " , " delete_not_scheduled " ,
" tmdb_person " , " build_collection " , " collection_order " , " collection_level " , " validate_builders " , " collection_name " , " sort_by " , " libraries "
" tmdb_person " , " build_collection " , " collection_order " , " collection_level " , " validate_builders " , " collection_name " , " sort_by " , " libraries "
]
]
details = [ " ignore_ids " , " ignore_imdb_ids " , " server_preroll " , " collection_changes_webhooks " , " collection_mode " ,
details = [ " ignore_ids " , " ignore_imdb_ids " , " server_preroll " , " collection_changes_webhooks " , " collection_mode " ,
" collection_minimum " , " label " ] + boolean_details + string_details
" collection_minimum " , " label " , " visible_library " , " visible_home " , " visible_shared " ] + boolean_details + string_details
collectionless_details = [ " collection_order " , " plex_collectionless " , " label " , " label_sync_mode " , " test " ] + \
collectionless_details = [ " collection_order " , " plex_collectionless " , " label " , " label_sync_mode " , " test " ] + \
poster_details + background_details + summary_details + string_details
poster_details + background_details + summary_details + string_details
item_bool_details = [ " item_tmdb_season_titles " , " item_assets " , " revert_overlay " , " item_lock_background " , " item_lock_poster " , " item_lock_title " , " item_refresh " ]
item_bool_details = [ " item_tmdb_season_titles " , " item_assets " , " revert_overlay " , " item_lock_background " , " item_lock_poster " , " item_lock_title " , " item_refresh " ]
@ -690,7 +687,7 @@ class CollectionBuilder:
elif datatype == " bool " :
elif datatype == " bool " :
if isinstance ( value , bool ) :
if isinstance ( value , bool ) :
return value
return value
elif isinstance ( value , int ) :
elif isinstance ( value , ( int , float ) ) :
return value > 0
return value > 0
elif str ( value ) . lower ( ) in [ " t " , " true " ] :
elif str ( value ) . lower ( ) in [ " t " , " true " ] :
return True
return True
@ -798,6 +795,28 @@ class CollectionBuilder:
self . details [ method_final ] = util . get_list ( method_data ) if method_data else [ ]
self . details [ method_final ] = util . get_list ( method_data ) if method_data else [ ]
elif method_name == " collection_changes_webhooks " :
elif method_name == " collection_changes_webhooks " :
self . details [ method_name ] = self . _parse ( method_name , method_data , datatype = " list " )
self . details [ method_name ] = self . _parse ( method_name , method_data , datatype = " list " )
elif method_name in [ " visible_library " , " visible_home " , " visible_shared " ] :
if isinstance ( method_data , bool ) :
self . details [ method_name ] = method_data
elif isinstance ( method_data , ( int , float ) ) :
self . details [ method_name ] = method_data > 0
elif str ( method_data ) . lower ( ) in [ " t " , " true " ] :
self . details [ method_name ] = True
elif str ( method_data ) . lower ( ) in [ " f " , " false " ] :
self . details [ method_name ] = False
else :
match = re . match ( " ^(1[0-2]|0?[1-9])/(3[01]|[12][0-9]|0?[1-9])-(1[0-2]|0?[1-9])/(3[01]|[12][0-9]|0?[1-9])$ " , method_data )
if not match :
logger . error ( f " { self . Type } Error: { method_name } must be either true, false or in the MM/DD-MM/DD format i.e. 12/01-12/25 " )
else :
month_start , day_start = util . check_day ( int ( match . group ( 1 ) ) , int ( match . group ( 2 ) ) )
month_end , day_end = util . check_day ( int ( match . group ( 3 ) ) , int ( match . group ( 4 ) ) )
month_check , day_check = util . check_day ( self . current_time . month , self . current_time . day )
check = datetime . strptime ( f " { month_check } / { day_check } " , " % m/ %d " )
start = datetime . strptime ( f " { month_start } / { day_start } " , " % m/ %d " )
end = datetime . strptime ( f " { month_end } / { day_end } " , " % m/ %d " )
logger . info ( f " \n { method_name } between { util . pretty_months [ month_start ] } { util . make_ordinal ( day_start ) } and { util . pretty_months [ month_end ] } { util . make_ordinal ( day_end ) } " )
self . details [ method_name ] = start < = check < = end if start < end else ( check < = end or check > = start )
elif method_name in boolean_details :
elif method_name in boolean_details :
default = self . details [ method_name ] if method_name in self . details else None
default = self . details [ method_name ] if method_name in self . details else None
self . details [ method_name ] = self . _parse ( method_name , method_data , datatype = " bool " , default = default )
self . details [ method_name ] = self . _parse ( method_name , method_data , datatype = " bool " , default = default )