feat(torrents): add seeding lifecycle and upload controls

This commit is contained in:
NimBold
2026-08-01 21:27:49 +03:30
parent bb64c4cd52
commit dea6ad1974
26 changed files with 663 additions and 25 deletions
+13
View File
@@ -26,6 +26,9 @@ pub enum DownloadStatus {
/// Post-download media processing such as yt-dlp/ffmpeg merging or
/// extraction. The queue permit is still held.
Processing,
/// A BitTorrent download has all selected data and is still seeding.
/// The Aria2 GID and queue permit remain live until seeding ends.
Seeding,
Paused,
Completed,
Failed,
@@ -42,6 +45,7 @@ impl DownloadStatus {
Self::Staged => "staged",
Self::Downloading => "downloading",
Self::Processing => "processing",
Self::Seeding => "seeding",
Self::Paused => "paused",
Self::Completed => "completed",
Self::Failed => "failed",
@@ -156,6 +160,15 @@ pub struct DownloadItem {
#[serde(default)]
#[ts(optional)]
pub torrent_info_hash: Option<String>,
#[serde(default)]
#[ts(optional)]
pub torrent_seed_time: Option<f64>,
#[serde(default)]
#[ts(optional)]
pub torrent_seed_ratio: Option<f64>,
#[serde(default)]
#[ts(optional)]
pub torrent_upload_limit: Option<String>,
}
#[derive(Clone, Debug, Serialize, Deserialize, TS)]