Commit graph

116 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
Jesse Bate
429f97a60c perf: exclude unused fields from ItemDTO list and WebSocket serialization
Every item_updated WebSocket event and every history/queue list response
was serializing the full ItemDTO including fields the UI never reads.

Add ItemDTO.serialize_for_list() which excludes: options,
template_chapter, temp_dir, total_bytes, total_bytes_estimate,
tmpfilename, archive_id. The global Encoder now uses serialize_for_list()
for all list/event contexts; the full serialize() remains available for
detail endpoints (GET /api/history/{id}).

Mark the excluded fields optional in the TypeScript StoreItem type.
2026-06-10 20:09:13 +09:30
Jesse Bate
38c120ce85 perf: lazy-load folders on demand; remove queue from config endpoint
Two startup cost reductions:

1. Folder enumeration is moved from /api/system/configuration to a new
   GET /api/system/folders endpoint. The frontend fetches it only when
   the user focuses a folder input field, and caches the result for the
   session. On large directory trees this was a noticeable startup delay.

2. The queue array is removed from /api/system/configuration. The queue
   is already loaded separately via /api/history/live on mount; including
   it in the config response was a double-load that inflated the initial
   payload for users with large queues.
2026-06-10 20:07:19 +09:30
Jesse Bate
e0dbc2d15d perf: throttle item_updated WebSocket events to 500ms intervals
yt-dlp fires progress hooks faster than the browser can usefully render
them. Previously every callback triggered a WebSocket emit → Vue
reactivity update → DOM re-render, causing unnecessary main-thread work
during active downloads.

Now status changes (e.g. downloading → finished) are always emitted
immediately, while progress-only updates are capped at one per 500ms
per download. A flush_pending() call at loop termination ensures the
final state is never dropped.
2026-06-10 19:32:31 +09:30
arabcoders
fa8ba1af34 feat: make log level runtime managable. 2026-05-28 21:26:23 +03:00
arabcoders
cf90db3b4c refactor: update log mesages to take advantage of JSONL 2026-05-27 23:53:42 +03:00
arabcoders
434d3e981d feat: add system diagnostics endpoint. 2026-05-26 19:22:36 +03:00
arabcoders
64fdcac0f7 refactor: implement re-extraction logic and process-safe handling for non-picklable objects. 2026-05-25 20:06:34 +03:00
arabcoders
2e9684de5d refactor: standardize JSONL structure. 2026-05-24 21:19:25 +03:00
arabcoders
88db357b7f refactor: removed thumbnail proxying 2026-05-18 12:28:06 +03:00
arabcoders
854f5f4b42 refactor: use jsonl for loggng for better log view experience 2026-05-18 09:44:29 +03:00
arabcoders
3bd2a7bee7 refactor: minor ui cleanup 2026-05-17 20:21:58 +03:00
arabcoders
734ef1c53c refactor: use item guid as thumbnail name for easier cleanup 2026-05-15 16:50:13 +03:00
arabcoders
d9dbbb18ea feat: thumbnail generation 2026-05-14 23:22:27 +03:00
arabcoders
56dbf6fc2d refactor: update test functions to use tmp_path for archive file handling 2026-05-08 21:56:41 +03:00
arabcoders
a0b50ac351 fix: use yt-dlp meta extractors methods instead of local rolled ones 2026-05-08 21:39:12 +03:00
arabcoders
12eb4de83d fix: update extractor options and improve media polling logic 2026-05-08 20:54:41 +03:00
arabcoders
928ddd5b9a feat: add generic browser extractor 2026-05-08 01:08:08 +03:00
arabcoders
9b3cc8b310 fix: respect sleep-requests arg in specific code paths. 2026-05-07 21:35:40 +03:00
arabcoders
691e37d279 fix: move dns lookup to thread 2026-05-07 18:34:50 +03:00
arabcoders
7ac7039592 chore: tests clean up 2026-05-04 22:23:19 +03:00
arabcoders
cca97d9a57 feat: extra placeholders for output template 2026-05-04 21:42:52 +03:00
arabcoders
285e661667 feat: add rename to history items. 2026-05-04 20:29:34 +03:00
arabcoders
11bd4204aa refactor: update terminal api 2026-04-29 22:25:39 +03:00
arabcoders
084f5082ad feat: add support for ignoring conditions in downloads and UI 2026-04-27 20:58:00 +03:00
arabcoders
fc6bc88e61 refactor: use one tmp directory for tests 2026-04-27 00:31:14 +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
3c1567930f feat: add system limits API endpoint and UI for download capacity overview 2026-04-22 22:02:40 +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
00404fc6d4 refactor: made _static.py dynamic 2026-04-18 19:26:44 +03:00
arabcoders
9337e81f62 refactor: remove useless tests 2026-04-15 18:13:04 +03:00
arabcoders
dbff4c6798 feat(console): make terminal window more durable and support reloading and stopping commands. 2026-04-14 02:19:35 +03:00
arabcoders
c70d5340f1 feat: implement patch to make Windows Popen support stopping live stream 2026-04-11 23:31:48 +03:00
arabcoders
f9119f5a33 fix: better partial live download handling 2026-04-11 19:13:00 +03:00
arabcoders
1fa60c3909 fix: playlist keys pre-processing. Closes #585 2026-04-10 18:26:54 +03:00
arabcoders
c3132858e7 feat: add download_skipped flag to track intentionally skipped downloads 2026-04-10 18:07:05 +03:00
arabcoders
90e07ce71b feat: improve the file browser with pagination. 2026-02-13 21:46:01 +03:00
arabcoders
19d5d60de1 feat: add NFO generation endpoint and UI integration for downloads 2026-02-13 20:38:33 +03:00
arabcoders
cebc72875b fix: update import path for fetch_info in HandleTask class. Closes #561 2026-02-11 18:44:32 +03:00
arabcoders
5844290d74 fix: sometimes downloads fails due to pickling issue 2026-02-08 03:45:56 +03:00
arabcoders
dfcbd2d23d chore: update external packages 2026-01-30 16:31:20 +03:00
arabcoders
f88422e92b Refactor: move log related inside the logs module 2026-01-28 16:22:44 +03:00
arabcoders
b1a05b1d79 refactor: move archiver to be under yt_dlp submodule 2026-01-27 20:04:54 +03:00
arabcoders
2c5edc64f4 refactor: isolate yt_dlp related code into submodule 2026-01-27 19:36:13 +03:00
arabcoders
3383d5d5dc refactor: move streaming logic to a feature submodule 2026-01-27 17:42:12 +03:00
arabcoders
fe0a1c5b70 fix: offload info extraction to ProcessPoolExecutor 2026-01-26 23:32:06 +03:00
arabcoders
98f25027bb refactor: use shared http clients 2026-01-26 17:42:24 +03:00
arabcoders
7d6dc7ae76 refactor: move presets to db model 2026-01-25 19:17:54 +03:00
arabcoders
fd4e755938 refactor: migrate tasks to db model 2026-01-24 23:09:20 +03:00
arabcoders
00c3aefff1 Feat: add yt-dlp version checker 2026-01-24 20:04:30 +03:00