mirror of
https://github.com/Drop-OSS/drop.git
synced 2026-07-26 17:54:44 +10:00
feat: Migrate to Apache opendal
This commit is contained in:
+34
-1
@@ -1,7 +1,40 @@
|
||||
use std::path::Path;
|
||||
use std::{collections::HashMap, path::Path};
|
||||
|
||||
use droplet_rs::manifest::{Manifest, generate_manifest_rusty};
|
||||
use indicatif::{ProgressBar, ProgressStyle};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct DepotManifest {
|
||||
content: HashMap<String, DepotManifestGameData>,
|
||||
}
|
||||
#[derive(Serialize, Deserialize)]
|
||||
struct DepotManifestGameData {
|
||||
version_id: String,
|
||||
compression: CompressionOption,
|
||||
}
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub enum CompressionOption {
|
||||
None,
|
||||
Gzip,
|
||||
Zstd,
|
||||
}
|
||||
impl DepotManifest {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
content: HashMap::new(),
|
||||
}
|
||||
}
|
||||
pub fn add(&mut self, game_id: String, version_id: String, compression: CompressionOption) {
|
||||
self.content.insert(
|
||||
game_id,
|
||||
DepotManifestGameData {
|
||||
version_id,
|
||||
compression,
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn generate_manifest(dir: &Path) -> anyhow::Result<Manifest> {
|
||||
let progress_bar = ProgressBar::new(100_00).with_style(
|
||||
|
||||
Reference in New Issue
Block a user