Commit graph

17 commits

Author SHA1 Message Date
Jesse Bate
687c82cb32 feat: add YTP_MAX_HISTORY to cap history and prevent unbounded DB growth
Long-running instances accumulate history indefinitely. As the history
table grows, SQLite COUNT(*), paginated SELECT, and index scans degrade.

YTP_MAX_HISTORY (default: 0 = unlimited) caps the number of completed
download records kept. Enforcement is a hook in DataStore.put(): on
each insertion, the oldest excess entries are immediately evicted from
the in-memory OrderedDict and their deletes are enqueued to SQLite.
DataStore.load() also trims on startup in case the limit was lowered
between restarts. No background tasks, no DB reads needed for the check.
2026-06-10 20:29:18 +09:30
arabcoders
1267dbaf6b refactor: use single logger namespace 2026-05-28 19:07:11 +03:00
arabcoders
39ed3d0361 refactor: add more context to the actual log message. 2026-05-28 17:56:28 +03:00
arabcoders
cf90db3b4c refactor: update log mesages to take advantage of JSONL 2026-05-27 23:53:42 +03:00
arabcoders
d18145f1c5 refactor: make clear message more clear 2026-05-18 07:44:37 +03:00
arabcoders
734ef1c53c refactor: use item guid as thumbnail name for easier cleanup 2026-05-15 16:50:13 +03:00
arabcoders
30a0c30d94 refactor: fix slowness in deleting big number of items
Co-authored-by: Copilot <copilot@github.com>
2026-04-24 23:18:14 +03:00
arabcoders
03cabe6c70 refactor: wait on db flush before returning in API history clear response 2026-04-21 22:56:46 +03:00
arabcoders
f9119f5a33 fix: better partial live download handling 2026-04-11 19:13:00 +03:00
arabcoders
2c5edc64f4 refactor: isolate yt_dlp related code into submodule 2026-01-27 19:36:13 +03:00
arabcoders
240a920b6c fix; proper fix for dispatching many websocket events 2026-01-27 11:46:00 +03:00
arabcoders
dae141a6c2 revert: changes to playlist processor 2026-01-27 10:41:17 +03:00
arabcoders
fe0a1c5b70 fix: offload info extraction to ProcessPoolExecutor 2026-01-26 23:32:06 +03:00
arabcoders
41bca681e5 refactor: limit item add 2026-01-26 16:36:14 +03:00
arabcoders
795943196e Refactor: replace direct extract_info calls to async fetch_info 2026-01-16 20:45:10 +03:00
arabcoders
48e653b70a refactor: limit concurrent extract info calls to prevent loop blocking 2026-01-14 16:11:21 +03:00
arabcoders
55a298e0ff Refactor: download module into testable chunks 2026-01-13 20:05:01 +03:00