Architecture
Task System
How CoreService, Task, TaskStage, and taskRecorder work together.
The task system revolves around three files: app/services/core_service.py, app/bases/models.py, and app/supports/recorder.py.
| Concept | Role | What to Watch When Changing It |
|---|---|---|
CoreService | AsyncIO scheduler running in a background thread. | Do not operate on QWidget directly from it. |
Task | A download or processing task. | New fields must stay compatible with persistence. |
TaskStage | A sub-progress unit, such as an HTTP chunk or media-processing stage. | The UI and extension use it to compute total progress. |
taskRecorder | Persists and restores task history. | Structural changes must keep old records readable. |
Scheduling Flow
- The UI or extension submits a URL.
CoreServiceruns parsing logic and creates aTask.- The task enters the queue and is controlled by the maximum concurrency limit.
- Running tasks update
TaskStage. - Completion, pause, or failure is written back to the recorder.
When a Change Is Risky
If you change state enums, task serialization, pause/resume behavior, or stage progress, that affects the UI, the browser extension, and historical task recovery. The risk is higher than a normal internal Feature Pack change.
