refactor(download manager): Fully separate & generic download manager

Signed-off-by: quexeky <git@quexeky.dev>
This commit is contained in:
quexeky
2025-01-02 12:16:17 +11:00
parent 6568faaf4f
commit cac612b176
15 changed files with 283 additions and 223 deletions

View File

@ -1,4 +1,25 @@
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct DownloadableMetadata {
id: String,
use serde::{Deserialize, Serialize};
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize, Clone)]
pub enum DownloadType {
Game,
Tool,
DLC,
Mod
}
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize, Clone)]
pub struct DownloadableMetadata {
pub id: String,
pub version: String,
pub download_type: DownloadType
}
impl DownloadableMetadata {
pub fn new(id: String, version: String, download_type: DownloadType) -> Self {
Self {
id,
version,
download_type
}
}
}