Skip to content

Commit

Permalink
Updater move stuff arround
Browse files Browse the repository at this point in the history
  • Loading branch information
core1024 committed Apr 19, 2024
1 parent 70c1949 commit 4fc97a9
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/stremio_app/updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,22 @@ impl Updater {
}
println!("Found update v{}", version);

// Download the new setup file
let mut installer_response = reqwest::blocking::get(installer.url.clone())?;
let size = installer_response.content_length();
let mut downloaded: u64 = 0;
let mut sha256 = Sha256::new();
let temp_dir = std::env::temp_dir();
let file_name = std::path::Path::new(installer.url.path())
.file_name()
.context("Invalid file name")?
.to_str()
.context("The path is not valid UTF-8")?
.to_string();

let temp_dir = std::env::temp_dir();
let dest = temp_dir.join(file_name);

std::thread::sleep(std::time::Duration::from_secs(2));
// Download the new setup file
let mut installer_response = reqwest::blocking::get(installer.url.clone())?;
let size = installer_response.content_length();
let mut downloaded: u64 = 0;
let mut sha256 = Sha256::new();

println!("Downloading {} to {}", installer.url, dest.display());

let mut chunk = [0u8; 8192];
Expand Down

0 comments on commit 4fc97a9

Please sign in to comment.