fix(home): server-owned growth window; expose days
Home omits growth_days; backend auto (or home_growth_days 1/7) picks the window. Response includes days alongside growth_days. Growth榜 link uses the returned days. Non-growth sorts treat omitted/auto as 7.
This commit is contained in:
1 parent
9163f47b76
commit
297d9279d8
5 files changed
+52
-28
No files matched your search
@@ -650,11 +650,10 @@ def _year_param(query: Mapping[str, list[str]]) -> int | None:
|
||||
|
||||
|
||||
def _growth_days_param(query: Mapping[str, list[str]]) -> int | str:
|
||||
"""榜单传 1~365;首页可传 auto(由查询层按 home_growth_days 解析)。"""
|
||||
"""省略或 auto:查询层按 home_growth_days 解析(默认 7→1)。
|
||||
榜单应显式传 1~365。"""
|
||||
raw = _optional_str(query, "growth_days")
|
||||
if raw is None:
|
||||
return 7
|
||||
if raw == "auto":
|
||||
if raw is None or raw == "auto":
|
||||
return "auto"
|
||||
try:
|
||||
value = int(raw)
|
||||
|
||||
Reference in new issue
Block a user