# cp0204/quark-auto-save architecture

> Architecture diagram of the GitHub repository cp0204/quark-auto-save, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cp0204/quark-auto-save
- Repository: https://github.com/cp0204/quark-auto-save

## Overview

Quark Auto Save automates scheduled Quark Drive check-ins and share-link saving, then organizes saved files and can notify users or refresh media libraries. The main workflow is configured and triggered through the WebUI or scheduler, processed by the task runner against Quark’s API, and extended through optional plugins. Search providers can discover links for task entry. Source excerpts show the WebUI launching work and search-provider calls, but not the complete task/plugin dispatch or notification invocation; those links are left unverified rather than inferred.

Main entry points: [`plugins`](https://github.com/cp0204/quark-auto-save/tree/main/plugins) (Plugin system), [`quark_auto_save.py`](https://github.com/cp0204/quark-auto-save/blob/main/quark_auto_save.py) (Task execution), [`app/run.py`](https://github.com/cp0204/quark-auto-save/blob/main/app/run.py) (WebUI and API), [`app/sdk/cloudsaver.py`](https://github.com/cp0204/quark-auto-save/blob/main/app/sdk/cloudsaver.py) (CloudSaver client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web management"]
  node_webui["WebUI and API<br/>[run.py]"]
  node_taskconfig["Task configuration<br/>[quark_config.json]"]
  node_searchapi["Search API<br/>[run.py]"]
end

subgraph group_tasks["Task processing"]
  node_quarktask["Task execution<br/>[quark_auto_save.py]"]
  node_quarkapi["Quark Drive API"]
  node_rename["File filtering and renaming<br/>[quark_auto_save.py]"]
end

subgraph group_search["Resource discovery"]
  node_cloudsaver["CloudSaver client<br/>[cloudsaver.py]"]
  node_pansou["PanSou client<br/>[pansou.py]"]
  node_timeformat["Date formatting<br/>[common.py]"]
  node_cloudsearch["CloudSaver service"]
  node_pansouservice["PanSou service"]
end

subgraph group_plugins["Post-save integrations"]
  node_pluginhost["Plugin system"]
  node_emby["Emby refresh<br/>[emby.py]"]
  node_plex["Plex refresh<br/>[plex.py]"]
  node_fnv["FnOS refresh<br/>[fnv.py]"]
  node_alist["Alist transfer<br/>[alist.py]"]
  node_alistsync["Alist sync<br/>[alist_sync.py]"]
  node_strm["STRM generation<br/>[alist_strm_gen.py]"]
  node_smartstrm["SmartStrm integration<br/>[smartstrm.py]"]
  node_aria2["Aria2 download<br/>[aria2.py]"]
  node_unarchive["Auto unarchive<br/>[auto_unarchive.py]"]
end

subgraph group_notify["Notifications"]
  node_notify["Push dispatcher<br/>[notify.py]"]
  node_pushservices["Push services"]
end

node_admin(("Operator"))

node_admin -->|"configures tasks"| node_webui
node_webui -->|"persists settings"| node_taskconfig
node_webui -->|"launches task"| node_quarktask
node_webui -->|"requests search"| node_searchapi
node_searchapi -->|"calls search"| node_cloudsaver
node_searchapi -->|"calls search"| node_pansou
node_cloudsaver -->|"queries"| node_cloudsearch
node_pansou -->|"queries"| node_pansouservice
node_cloudsaver -->|"formats dates"| node_timeformat
node_pansou -->|"formats dates"| node_timeformat
node_quarktask -.->|"uses API"| node_quarkapi
node_quarktask -->|"filters and renames"| node_rename
node_quarktask -.->|"runs extensions"| node_pluginhost
node_pluginhost -.->|"optional refresh"| node_emby
node_pluginhost -.->|"optional refresh"| node_plex
node_pluginhost -.->|"optional refresh"| node_fnv
node_pluginhost -.->|"optional transfer"| node_alist
node_pluginhost -.->|"optional sync"| node_alistsync
node_pluginhost -.->|"optional generation"| node_strm
node_pluginhost -.->|"optional integration"| node_smartstrm
node_pluginhost -.->|"optional download"| node_aria2
node_pluginhost -.->|"optional extraction"| node_unarchive
node_quarktask -.->|"sends updates"| node_notify
node_notify -->|"dispatches pushes"| node_pushservices

click node_webui "https://github.com/cp0204/quark-auto-save/blob/main/app/run.py"
click node_taskconfig "https://github.com/cp0204/quark-auto-save/blob/main/quark_config.json"
click node_searchapi "https://github.com/cp0204/quark-auto-save/blob/main/app/run.py"
click node_cloudsaver "https://github.com/cp0204/quark-auto-save/blob/main/app/sdk/cloudsaver.py"
click node_pansou "https://github.com/cp0204/quark-auto-save/blob/main/app/sdk/pansou.py"
click node_timeformat "https://github.com/cp0204/quark-auto-save/blob/main/app/sdk/common.py"
click node_quarktask "https://github.com/cp0204/quark-auto-save/blob/main/quark_auto_save.py"
click node_rename "https://github.com/cp0204/quark-auto-save/blob/main/quark_auto_save.py"
click node_pluginhost "https://github.com/cp0204/quark-auto-save/tree/main/plugins"
click node_emby "https://github.com/cp0204/quark-auto-save/blob/main/plugins/emby.py"
click node_plex "https://github.com/cp0204/quark-auto-save/blob/main/plugins/plex.py"
click node_fnv "https://github.com/cp0204/quark-auto-save/blob/main/plugins/fnv.py"
click node_alist "https://github.com/cp0204/quark-auto-save/blob/main/plugins/alist.py"
click node_alistsync "https://github.com/cp0204/quark-auto-save/blob/main/plugins/alist_sync.py"
click node_strm "https://github.com/cp0204/quark-auto-save/blob/main/plugins/alist_strm_gen.py"
click node_smartstrm "https://github.com/cp0204/quark-auto-save/blob/main/plugins/smartstrm.py"
click node_aria2 "https://github.com/cp0204/quark-auto-save/blob/main/plugins/aria2.py"
click node_unarchive "https://github.com/cp0204/quark-auto-save/blob/main/plugins/auto_unarchive.py"
click node_notify "https://github.com/cp0204/quark-auto-save/blob/main/notify.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_webui,node_taskconfig,node_searchapi toneBlue
class node_quarktask,node_quarkapi,node_rename toneAmber
class node_cloudsaver,node_pansou,node_timeformat,node_cloudsearch,node_pansouservice toneMint
class node_pluginhost,node_emby,node_plex,node_fnv,node_alist,node_alistsync,node_strm,node_smartstrm,node_aria2,node_unarchive toneRose
class node_notify,node_pushservices,node_admin toneIndigo
```

## Components

### Web management

- [WebUI and API](https://github.com/cp0204/quark-auto-save/blob/main/app/run.py): `app/run.py`
- [Task configuration](https://github.com/cp0204/quark-auto-save/blob/main/quark_config.json): `quark_config.json`
- [Search API](https://github.com/cp0204/quark-auto-save/blob/main/app/run.py): `app/run.py`

### Task processing

- [Task execution](https://github.com/cp0204/quark-auto-save/blob/main/quark_auto_save.py): `quark_auto_save.py`
- **Quark Drive API**
- [File filtering and renaming](https://github.com/cp0204/quark-auto-save/blob/main/quark_auto_save.py): `quark_auto_save.py`

### Resource discovery

- [CloudSaver client](https://github.com/cp0204/quark-auto-save/blob/main/app/sdk/cloudsaver.py): `app/sdk/cloudsaver.py`
- [PanSou client](https://github.com/cp0204/quark-auto-save/blob/main/app/sdk/pansou.py): `app/sdk/pansou.py`
- [Date formatting](https://github.com/cp0204/quark-auto-save/blob/main/app/sdk/common.py): `app/sdk/common.py`
- **CloudSaver service**
- **PanSou service**

### Post-save integrations

- [Plugin system](https://github.com/cp0204/quark-auto-save/tree/main/plugins): `plugins`
- [Emby refresh](https://github.com/cp0204/quark-auto-save/blob/main/plugins/emby.py): `plugins/emby.py`
- [Plex refresh](https://github.com/cp0204/quark-auto-save/blob/main/plugins/plex.py): `plugins/plex.py`
- [FnOS refresh](https://github.com/cp0204/quark-auto-save/blob/main/plugins/fnv.py): `plugins/fnv.py`
- [Alist transfer](https://github.com/cp0204/quark-auto-save/blob/main/plugins/alist.py): `plugins/alist.py`
- [Alist sync](https://github.com/cp0204/quark-auto-save/blob/main/plugins/alist_sync.py): `plugins/alist_sync.py`
- [STRM generation](https://github.com/cp0204/quark-auto-save/blob/main/plugins/alist_strm_gen.py): `plugins/alist_strm_gen.py`
- [SmartStrm integration](https://github.com/cp0204/quark-auto-save/blob/main/plugins/smartstrm.py): `plugins/smartstrm.py`
- [Aria2 download](https://github.com/cp0204/quark-auto-save/blob/main/plugins/aria2.py): `plugins/aria2.py`
- [Auto unarchive](https://github.com/cp0204/quark-auto-save/blob/main/plugins/auto_unarchive.py): `plugins/auto_unarchive.py`

### Notifications

- [Push dispatcher](https://github.com/cp0204/quark-auto-save/blob/main/notify.py): `notify.py`
- **Push services**

### Other components

- **Operator**

## Connections

- Operator → WebUI and API: configures tasks (evidence: `README.md`)
- WebUI and API → Task configuration: persists settings (evidence: `app/run.py`)
- WebUI and API → Task execution: launches task (evidence: `app/run.py`)
- WebUI and API → Search API: requests search (evidence: `app/run.py`)
- Search API → CloudSaver client: calls search (evidence: `app/run.py`)
- Search API → PanSou client: calls search (evidence: `app/run.py`)
- CloudSaver client → CloudSaver service: queries (evidence: `app/sdk/cloudsaver.py`)
- PanSou client → PanSou service: queries (evidence: `app/sdk/pansou.py`)
- CloudSaver client → Date formatting: formats dates (evidence: `app/sdk/cloudsaver.py`)
- PanSou client → Date formatting: formats dates (evidence: `app/sdk/pansou.py`)
- Task execution → Quark Drive API: uses API
- Task execution → File filtering and renaming: filters and renames (evidence: `README.md`)
- Task execution → Plugin system: runs extensions
- Plugin system → Emby refresh: optional refresh (evidence: `README.md`)
- Plugin system → Plex refresh: optional refresh (evidence: `plugins/plex.py`)
- Plugin system → FnOS refresh: optional refresh (evidence: `plugins/fnv.py`)
- Plugin system → Alist transfer: optional transfer (evidence: `plugins/alist.py`)
- Plugin system → Alist sync: optional sync (evidence: `plugins/alist_sync.py`)
- Plugin system → STRM generation: optional generation (evidence: `README.md`)
- Plugin system → SmartStrm integration: optional integration (evidence: `README.md`)
- Plugin system → Aria2 download: optional download (evidence: `plugins/aria2.py`)
- Plugin system → Auto unarchive: optional extraction (evidence: `plugins/auto_unarchive.py`)
- Task execution → Push dispatcher: sends updates (evidence: `quark_auto_save.py`)
- Push dispatcher → Push services: dispatches pushes (evidence: `notify.py`)
