diff --git a/server/app.py b/server/app.py index 7b275b2..7556d8d 100644 --- a/server/app.py +++ b/server/app.py @@ -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] = {}, @@ -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( diff --git a/server/templates/macros.htm b/server/templates/macros.htm index ef60e70..e923161 100644 --- a/server/templates/macros.htm +++ b/server/templates/macros.htm @@ -393,6 +393,7 @@