Skip to content

Commit

Permalink
renamed download_save_file to download_save_sub
Browse files Browse the repository at this point in the history
  • Loading branch information
Marc Ratés committed Jan 8, 2024
1 parent 078ed5c commit c29a5aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ fn process_id_key_with_zenity(
//Returs file_id
Ok(value.to_string())
} else {
Err("Error selecting movie")?
Err("Error selecting movie.")?
}
} else {
Err("Movie not selected.")?
Expand Down Expand Up @@ -396,7 +396,7 @@ pub fn download_link(
}

//Downloads the sub and saves it
pub fn download_save_file(sub_url: &str, path: &str) -> Result<(), Box<dyn Error>> {
pub fn download_save_sub(sub_url: &str, path: &str) -> Result<(), Box<dyn Error>> {
let mut sub_path = PathBuf::from(path);
sub_path.set_extension("srt");

Expand Down
5 changes: 3 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use getopts::Options;
use osd::download_link;
use osd::download_save_file;
use osd::download_save_sub;
use osd::login;
use osd::search_for_subtitle_id_key;
use osd::Movie;
Expand Down Expand Up @@ -237,7 +237,8 @@ fn run(parsed_args: ParsedArgs, config: Config) -> Result<(), Box<dyn Error>> {
println!("Requests reset time: {}", url.reset_time);
}

download_save_file(&url.link, &movie.path)?;
//Downloads the subtitle and saves on the correct path
download_save_sub(&url.link, &movie.path)?;

Ok(())
}
Expand Down

0 comments on commit c29a5aa

Please sign in to comment.