Compare commits

...

5 Commits

@ -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"

@ -393,6 +393,7 @@
<div class="sidebar-box">
<a class="sidebar-button button" href="/recommendations/adaptive">Adaptive</a>
<a class="sidebar-button button" href="/recommendations/short_filler">Small Fillers</a>
<a class="sidebar-button button" href="/recommendations/infotainment">Infotainment</a>
<a class="sidebar-button button" href="/recommendations/series_episode">Series Episode</a>
<a class="sidebar-button button" href="/recommendations/movie_like">Movie Like</a>
</div>
@ -405,7 +406,7 @@
</div>
<button id="select_button_watch" onclick="select_watch();">watched</button>
<button id="select_button_ignore" onclick="select_ignore();">ignored</button>
<button id="select_button_dependent" onclick="select_dependent();">make dependent</button>
<button id="select_button_dependent" onclick="select_dependent();" title="videos will then block each other ordered by release date">make dependent</button>
<button id="select_button_" onclick="select_clear();">clear selection</button>
</div>
{%- endmacro %}
@ -449,8 +450,8 @@
{{ post_form(api_uri, "ignored", "true", "&#10005;"|safe, fragment) }}
{% endif %}
{% if show_rating %}
{{ post_form("/cookies/rating/positive", "media_id", element.id|string, "+", fragment) }}
{{ post_form("/cookies/rating/negative", "media_id", element.id|string, "-", fragment) }}
{{ post_form("/cookies/rating/positive", "media_id", element.id|string, "+") }}
{{ post_form("/cookies/rating/negative", "media_id", element.id|string, "-") }}
{% endif %}
{% endmacro %}

Loading…
Cancel
Save