Commit Graph

4 Commits

Author SHA1 Message Date
forust 6e3966aeb5 feat: add multi-account data layer with legacy migration
- GlobalStateStore for account registry in global state.json
- AccountStateStore for per-account settings (channels, credentials, continuous config)
- migrate_legacy_state() copies legacy data/ to data/accounts/default/
  with progress logging; renames session.session to default.session
- Helpers: account_data_dir(), account_session_path(), list_accounts(),
  load_account(), save_account(), get_account_store(), get_global_store()
- StateStore accepts defaults parameter for flexible default values
2026-06-27 15:20:09 +02:00
forust ac5beb831b lint: fix bare except and unused variables 2026-06-19 11:52:30 +02:00
forust 1dfe41950e Add graceful shutdown, logging, streaming with Range Requests, and state.json cache
- Graceful shutdown: SIGTERM/SIGINT handlers stop continuous scraper,
  disconnect Telegram client, drain running jobs with timeout
- Logging: replace print() with logging module throughout web server,
  basicConfig in main.py with structured log format
- Streaming: chunked file reads (64KB) instead of loading entire files
  into memory; full HTTP Range Request support (206 Partial Content)
  for video seeking in the browser
- Cache: TTL-based in-memory cache (1s) for state.json reads in
  StateStore, thread-safe with existing RLock
- Bugfix: send_error_json now converts HTTPStatus to int for JSON
2026-05-27 00:14:26 +02:00
forust d49fe28f08 Refactor server state and add health checks 2026-05-24 22:24:13 +02:00