/api/v1/set-last-datewww.fioapi.cz instead of fioapi.fio.czrequests library not in pyproject.tomlfio_fetch_py/fiofetch/api.pyrequests, datetime, timedelta at module levelfioapi.fio.czTimeout → User-friendly timeout messageConnectionError → Clear connection error messageHTTPError → Specific messages for 401, 403, 409 (rate limit)mask_token() function to mask tokens in all error logs and messagespyproject.tomlrequests>=2.31.0 to dependenciesback_date_days_SETUP.md - Complete setup and usage guideREADME.md - Added back date days section with examplesfio_fetch_webui/src/components/FetchControl.jsxAfter deploying these changes:
cd fio_fetch_py && uv sync/api/v1/set-last-dateRequest:
{
"days_back": 3 // Optional, defaults to config value
}
Success Response (200):
{
"message": "Successfully set last date to 2025-11-25 (3 days back)",
"target_date": "2025-11-25",
"days_back": 3
}
Error Responses:
400 - Invalid input or token not configured503 - Connection error504 - Timeout401/403 - Invalid token409 - Rate limit exceeded (Fio API)/api/v1/configResponse now includes:
{
...
"back_date_days": 3
}
/api/v1/configRequest can now include:
{
"back_date_days": 7 // Optional
}
New configuration option:
--back-date-days 3FIO_FETCH_BACK_DATE_DAYS=3back-date-days: 3No breaking changes. All existing functionality remains intact.
New functionality is additive:
fio_fetch_py/fiofetch/api.py - Fixed URL, added error handlingfio_fetch_py/fiofetch/config.py - Added back_date_days config (already done)fio_fetch_py/pyproject.toml - Added requests dependencyfio_fetch_py/README.md - Added back date days documentationfio_fetch_py/back_date_days_SETUP.md - New detailed guide (created)fio_fetch_webui/src/services/api.js - Added setLastDate function (already done)fio_fetch_webui/src/components/FetchControl.jsx - Improved error handlingfio_fetch_webui/src/components/ConfigPanel.jsx - Added back_date_days config (already done)Update backend dependencies:
cd fio_fetch_py
uv sync
Restart backend server:
# Stop existing server
# Start with updated code
fiofetch
No frontend rebuild needed (unless you want to)
Verify:
# Check API is working
curl http://localhost:3000/api/v1/config
# Should show: "back_date_days": 3
fioapi.fio.cz