@ -76,13 +76,13 @@ summary_details = [
]
poster_details = [ " url_poster " , " tmdb_poster " , " tmdb_profile " , " tvdb_poster " , " file_poster " ]
background_details = [ " url_background " , " tmdb_background " , " tvdb_background " , " file_background " ]
boolean_details = [ " visible_library " , " visible_home " , " visible_shared " , " show_filtered " , " show_missing " , " save_missing " , " item_assets " , " missing_only_released " , " revert_overlay " ]
boolean_details = [ " visible_library " , " visible_home " , " visible_shared " , " show_filtered " , " show_missing " , " save_missing " , " item_assets " , " missing_only_released " , " revert_overlay " , " delete_below_minimum " ]
string_details = [ " sort_title " , " content_rating " , " name_mapping " ]
ignored_details = [
" smart_filter " , " smart_label " , " smart_url " , " run_again " , " schedule " , " sync_mode " , " template " , " test " ,
" tmdb_person " , " build_collection " , " collection_order " , " collection_level " , " validate_builders " , " collection_name "
]
details = [ " collection_mode " , " collection_order " , " collection_level " , " label" ] + boolean_details + string_details
details = [ " collection_mode " , " collection_order " , " collection_level " , " collection_minimum" , " label" ] + boolean_details + string_details
collectionless_details = [ " collection_order " , " plex_collectionless " , " label " , " label_sync_mode " , " test " ] + \
poster_details + background_details + summary_details + string_details
item_details = [ " item_label " , " item_radarr_tag " , " item_sonarr_tag " , " item_overlay " ] + list ( plex . item_advance_keys . keys ( ) )
@ -187,6 +187,8 @@ class CollectionBuilder:
self . backgrounds = { }
self . summaries = { }
self . schedule = " "
self . minimum = self . library . collection_minimum
self . delete_below_minimum = self . library . delete_below_minimum
self . current_time = datetime . now ( )
self . current_year = self . current_time . year
@ -679,6 +681,8 @@ class CollectionBuilder:
self . details [ method_name ] = plex . collection_mode_options [ str ( method_data ) . lower ( ) ]
else :
raise Failed ( f " Collection Error: { method_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) " )
elif method_name == " collection_minimum " :
self . minimum = util . parse ( method_name , method_data , datatype = " int " , minimum = 1 )
elif method_name == " label " :
if " label " in methods and " label.sync " in methods :
raise Failed ( " Collection Error: Cannot use label and label.sync together " )
@ -1815,6 +1819,10 @@ class CollectionBuilder:
os . remove ( og_image )
self . config . Cache . update_image_map ( item . ratingKey , self . library . image_table_name , " " , " " )
def delete_collection ( self ) :
if self . obj :
self . library . query ( self . obj . delete )
def update_details ( self ) :
if not self . obj and self . smart_url :
self . library . create_smart_collection ( self . name , self . smart_type_key , self . smart_url )