Move the download manager to the gtk crate.
This commit is contained in:
parent
e9dd297bf3
commit
13ba2762ad
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -599,7 +599,6 @@ dependencies = [
|
||||
"glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hammond-data 0.1.0",
|
||||
"hyper 0.11.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"mime_guess 1.8.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"reqwest 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
||||
@ -12,7 +12,6 @@ mime_guess = "1.8.3"
|
||||
reqwest = "0.8.2"
|
||||
tempdir = "0.3.5"
|
||||
glob = "0.2.11"
|
||||
lazy_static = "1.0.0"
|
||||
|
||||
[dependencies.diesel]
|
||||
features = ["sqlite"]
|
||||
|
||||
@ -7,8 +7,6 @@ extern crate glob;
|
||||
extern crate hammond_data;
|
||||
extern crate hyper;
|
||||
#[macro_use]
|
||||
extern crate lazy_static;
|
||||
#[macro_use]
|
||||
extern crate log;
|
||||
extern crate mime_guess;
|
||||
extern crate reqwest;
|
||||
@ -16,4 +14,3 @@ extern crate tempdir;
|
||||
|
||||
pub mod downloader;
|
||||
pub mod errors;
|
||||
pub mod manager;
|
||||
|
||||
@ -5,9 +5,9 @@ use gtk::prelude::*;
|
||||
use gio::{ActionMapExt, ApplicationExt, ApplicationExtManual, SimpleActionExt};
|
||||
|
||||
use hammond_data::utils::checkup;
|
||||
use hammond_downloader::manager::Manager;
|
||||
use hammond_data::Source;
|
||||
|
||||
use manager::Manager;
|
||||
use headerbar::Header;
|
||||
use content::Content;
|
||||
use utils;
|
||||
|
||||
@ -53,6 +53,7 @@ mod content;
|
||||
mod app;
|
||||
|
||||
mod utils;
|
||||
mod manager;
|
||||
mod static_resource;
|
||||
|
||||
use app::App;
|
||||
|
||||
@ -1,31 +1,30 @@
|
||||
use hammond_data::Episode;
|
||||
// use hammond_data::Episode;
|
||||
use hammond_data::dbqueries;
|
||||
|
||||
use downloader::get_episode;
|
||||
use hammond_downloader::downloader::get_episode;
|
||||
|
||||
use std::collections::HashSet;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::path::PathBuf;
|
||||
// use std::path::PathBuf;
|
||||
use std::thread;
|
||||
|
||||
struct DonwloadInstance {
|
||||
uri: String,
|
||||
// FIXME: MAKE ME A PATHBUF
|
||||
local_uri: Option<String>,
|
||||
downloaded_bytes: u64,
|
||||
total_bytes: u64,
|
||||
}
|
||||
// struct DonwloadInstance {
|
||||
// uri: String,
|
||||
// // FIXME: MAKE ME A PATHBUF
|
||||
// local_uri: Option<String>,
|
||||
// downloaded_bytes: u64,
|
||||
// total_bytes: u64,
|
||||
// }
|
||||
|
||||
impl DonwloadInstance {
|
||||
fn new(url: &str, total_bytes: u64) -> Self {
|
||||
DonwloadInstance {
|
||||
uri: url.into(),
|
||||
local_uri: None,
|
||||
downloaded_bytes: 0,
|
||||
total_bytes,
|
||||
}
|
||||
}
|
||||
}
|
||||
// impl DonwloadInstance {
|
||||
// fn new(url: &str, total_bytes: u64) -> Self {
|
||||
// DonwloadInstance {
|
||||
// uri: url.into(),
|
||||
// local_uri: None,
|
||||
// downloaded_bytes: 0,
|
||||
// total_bytes,
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
// FIXME: privacy stuff
|
||||
@ -70,7 +69,7 @@ impl Manager {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use downloader;
|
||||
use hammond_downloader::downloader;
|
||||
|
||||
use diesel::Identifiable;
|
||||
|
||||
@ -14,10 +14,8 @@ use hammond_data::errors::*;
|
||||
use hammond_downloader::downloader;
|
||||
|
||||
use app::DOWNLOADS_MANAGER;
|
||||
|
||||
use app::Action;
|
||||
|
||||
use std::thread;
|
||||
use std::sync::mpsc::Sender;
|
||||
use std::path::Path;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user