fix(scenes): min_duration_sec=0 znaczy bez progu, nie duration_sec >= 0

Zgloszenie 2ec95be5 ("Hentaimama dalej 0 scen") bylo trafne, mimo ze drill-downy
juz wysylaly min_duration_sec=0. Backend tlumaczyl to na duration_sec >= 0, a w SQL
NULL nie przechodzi ZADNEGO porownania, wiec scena o nieznanej dlugosci wypadala
dokladnie tak samo jak dziesieciosekundowy smiec. Serwisy, ktore dlugosci nie podaja
w ogole (hentaimama, javflix, supjav, hentaigasm, hentaiplay, xanimeporn to 100%
NULL), oddawaly PUSTA liste.

Teraz 0 znaczy brak progu i filtr w ogole sie nie naklada, a prog > 0 dalej odcina
NULL-e swiadomie, bo tam chodzi o smieci w glownym feedzie. To samo rozroznienie w
scieszce "pure default", zeby jawne 0 nie gubilo taniego liczenia.

Zweryfikowane na produkcji: hentaimama, javflix, supjav, hentaigasm i xanimeporn
oddaja sceny, glowny feed z progiem 60 bez zmian.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
goon-foss 2026-08-20 16:03:51 +02:00
parent 8f6fa8c732
commit 34276afb71

View file

@ -379,7 +379,14 @@ def list_scenes(
for _bl_clause in blacklist_clauses(session, device_id): for _bl_clause in blacklist_clauses(session, device_id):
base = base.where(_bl_clause) base = base.where(_bl_clause)
if min_duration_sec is not None: # `min_duration_sec=0` znaczy "bez progu", a NIE `duration_sec >= 0`. To rozroznienie
# jest tu istotne, bo w SQL NULL nie przechodzi ZADNEGO porownania: przy `>= 0` scena
# o NIEZNANEJ dlugosci wypadala tak samo jak dziesieciosekundowy smiec. Dla serwisow,
# ktore dlugosci nie podaja w ogole (hentaimama, javflix, supjav, hentaigasm,
# hentaiplay, xanimeporn maja 100% NULL), lista wychodzila PUSTA, mimo ze wejscie w
# konkretny serwis jest jawna prosba usera o jego zawartosc. Prog > 0 dalej odcina
# NULL-e swiadomie, bo tam filtrujemy smieci w glownym feedzie.
if min_duration_sec:
base = base.where(Scene.duration_sec >= min_duration_sec) base = base.where(Scene.duration_sec >= min_duration_sec)
if max_duration_sec is not None: if max_duration_sec is not None:
base = base.where(Scene.duration_sec <= max_duration_sec) base = base.where(Scene.duration_sec <= max_duration_sec)
@ -409,7 +416,7 @@ def list_scenes(
_is_pure_default = ( _is_pure_default = (
not include_stubs and not q and not studio_slug_list and not tag_slug_list not include_stubs and not q and not studio_slug_list and not tag_slug_list
and not perf_id_strings and origin is None and has_playback is None and not perf_id_strings and origin is None and has_playback is None
and min_duration_sec is None and not min_duration_sec
and max_duration_sec is None and released_within_days is None and max_duration_sec is None and released_within_days is None
and min_quality_p is None and not jav and vertical is None and min_quality_p is None and not jav and vertical is None
) )