fix: 지금 구간 각 점수와 '지금' 칸은 지금 시각부터 (이미 지난 시각의 단기예보 비가 남아 우산각 1위·비 아이콘이 나오던 것)
This commit is contained in:
1 parent
260ded8c79
commit
0b536e1f90
4 files changed
+43
-8
No files matched your search
@@ -177,9 +177,11 @@ class WeatherService:
|
||||
)
|
||||
by_at = with_ultra_rain({r.forecast_at: r for r in rows}, ultra)
|
||||
slots = []
|
||||
hour_now = now.replace(minute=0, second=0, microsecond=0)
|
||||
for h in SLOT_HOURS:
|
||||
at = start + timedelta(hours=h)
|
||||
row = by_at.get(at)
|
||||
# 지금이 든 칸은 칸 첫 시각 대신 지금 시각 예보 (이미 지난 시각의 비가 '지금'으로 보이지 않게)
|
||||
row = by_at.get(hour_now) if at <= now < at + timedelta(hours=3) and hour_now in by_at else by_at.get(at)
|
||||
icon, tone, note = _slot_view(at, row, sun)
|
||||
if note == "노을" and sunset_score is not None:
|
||||
note = f"노을 {sunset_score}"
|
||||
|
||||
Reference in new issue
Block a user