@ -77,6 +77,11 @@ from entertainment_decider.extras import (
T = TypeVar ( " T " )
INFOTAINMENT_POINTS_MAPPING = {
102 : - 100 , # Infotainment
}
def adapt_score_list (
base : Optional [ PreferenceScore ] = None ,
tag_points_mapping : Dict [ int , int ] = { } ,
@ -108,7 +113,7 @@ _LOG_LEVELS = {
" httpx " : logging . WARNING , # >DEBUG to hide outgoing SSL infos
" werkzeug " : logging . INFO , # INFO so incoming requests show up
}
for module_name , log_level in _LOG_LEVELS . items ( ) :
for module_name , log_level in _LOG_LEVELS . items ( ) :
logging . getLogger ( module_name ) . setLevel ( log_level )
@ -609,6 +614,22 @@ def recommend_short_filler() -> ResponseReturnValue:
)
@flask_app.route ( " /recommendations/infotainment " )
def recommend_infotainment ( ) - > ResponseReturnValue :
return render_template (
" recommendations_simple.htm " ,
mode_name = " Infotainment " ,
media_list = generate_preference_list (
object_gen = lambda : get_all_considered (
order_by = " elem.release_date DESC " ,
) ,
score_adapt = 1 ,
base = adapt_score_list ( tag_points_mapping = INFOTAINMENT_POINTS_MAPPING ) ,
limit = 24 ,
) ,
)
@flask_app.route ( " /recommendations/series_episode " )
def recommend_series_episode ( ) - > ResponseReturnValue :
return render_template (
@ -1361,3 +1382,4 @@ def api_tag(tag_id: int) -> ResponseReturnValue:
} , 400
tag . set ( * * { key : KEY_CONVETER [ key ] ( val ) for key , val in data . items ( ) } )
return redirect_back_or_okay ( )
assert False , f " { request . method } unsupported "