provozni zaloha
This commit is contained in:
@@ -42,11 +42,11 @@ def fires_in_window(conn, start: datetime, end: datetime) -> list[dict]:
|
||||
return fires
|
||||
|
||||
|
||||
def format_upcoming(fires: list[dict]) -> list[str]:
|
||||
def format_upcoming(fires: list[dict], id_to_display: dict[int, int]) -> list[str]:
|
||||
if not fires:
|
||||
return ["(nothing scheduled in this window)"]
|
||||
return [
|
||||
f"{f['fire_time']:%Y-%m-%d %H:%M} #{f['id']} {f['text']} ({f['schedule_type']})"
|
||||
f"{f['fire_time']:%Y-%m-%d %H:%M} #{id_to_display[f['id']]} {f['text']} ({f['schedule_type']})"
|
||||
for f in fires
|
||||
]
|
||||
|
||||
@@ -93,7 +93,7 @@ def _random_fires(conn, start: datetime, end: datetime) -> list[dict]:
|
||||
rows = conn.execute(
|
||||
"""
|
||||
SELECT r.id, r.text, sr.times_per_day, sr.window_start, sr.window_end,
|
||||
sr.days_filter, sr.from_date, sr.until_date
|
||||
sr.days_filter, sr.from_date, sr.until_date, sr.period
|
||||
FROM reminders r
|
||||
JOIN schedule_random sr ON sr.reminder_id = r.id
|
||||
WHERE r.enabled = 1 AND r.deleted_at IS NULL
|
||||
|
||||
Reference in New Issue
Block a user