Development

This commit is contained in:
Matthew Grotke 2026-05-23 03:19:35 -04:00
parent b0892a2ddd
commit 50e2beb2cb

View file

@ -4,6 +4,7 @@ import json, re, subprocess, os, sys, html as html_mod
import sanitize
import validation as validate
from datetime import datetime, timezone
from zoneinfo import ZoneInfo, ZoneInfoNotFoundError
from config_utils import core_hash, get_pending_entries, get_dashboard_pending, _seconds_until_next_run, _format_timing, _is_locked, _lock_mtime, PRODUCT_DISPLAY_NAME
bp = Blueprint('view_page', __name__)
@ -430,7 +431,12 @@ def _blocklist_stats_html(core):
entries = sum(1 for _ in f)
mtime = int(os.path.getmtime(bl_path))
size_str = _fmt_bytes(os.path.getsize(bl_path))
last_refreshed = f'{datetime.fromtimestamp(mtime).strftime("%Y-%m-%d %H:%M")} ({_relative_time(mtime)})'
tz_name = session.get('timezone', '')
try:
tz = ZoneInfo(tz_name) if tz_name else timezone.utc
except ZoneInfoNotFoundError:
tz = timezone.utc
last_refreshed = f'{datetime.fromtimestamp(mtime, tz=tz).strftime("%Y-%m-%d %H:%M")} ({_relative_time(mtime)})'
except Exception:
entries, size_str, last_refreshed = '-', '-', 'Never'
rows += (f'<tr>'