Revert "refactor(download manager): Moved manifest and stored_manifest to download_manager"

This reverts commit 8db239334688912f2be30023f4220c3e149df7d6.
This commit is contained in:
quexeky
2024-12-31 13:05:51 +11:00
parent ece79e4306
commit 01383b514b
10 changed files with 37 additions and 46 deletions
+12 -28
View File
@@ -1,42 +1,26 @@
use std::{path::PathBuf, sync::Arc};
use std::path::PathBuf;
use rustix::path::Arg;
use super::external_component::ExternalComponent;
use crate::download_manager::{download_thread_control_flag::DownloadThreadControl, downloadable::Downloadable, progress_object::ProgressObject};
pub struct ToolDownloader {
id: String,
pub struct Tool {
name: String,
version: String,
location: Option<PathBuf>,
progress: Arc<ProgressObject>,
control_flag: DownloadThreadControl
}
impl Downloadable for ToolDownloader {
fn get_progress_object(&self) -> std::sync::Arc<crate::download_manager::progress_object::ProgressObject> {
impl ExternalComponent for Tool {
fn download(&mut self) {
todo!()
}
fn version(&self) -> String {
self.version.clone()
fn version(&self) -> &String {
&self.version
}
fn id(&self) -> String {
self.id.clone()
fn is_installed(&self) -> bool {
self.location.is_some()
}
fn download(&mut self) -> Result<(), crate::download_manager::application_download_error::ApplicationDownloadError> {
todo!()
}
fn progress(&self) -> Arc<ProgressObject> {
self.progress.clone()
}
fn control_flag(&self) -> DownloadThreadControl {
self.control_flag.clone()
}
fn install_dir(&self) -> String {
self.location.clone().unwrap().to_string_lossy().to_string()
fn location(&self) -> &Option<PathBuf> {
&self.location
}
}