diff --git a/src/main.rs b/src/main.rs index d78a3ac..3f35786 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,5 @@ use chrono::{DateTime, Utc}; use clap::Parser; -use tokio; use youtube::{create_default_metadata, load_oauth_config, load_video_metadata, YouTubeUploader}; use youtube_scheduler::*; diff --git a/src/youtube.rs b/src/youtube.rs index 2bea596..4dcfecb 100644 --- a/src/youtube.rs +++ b/src/youtube.rs @@ -257,11 +257,10 @@ impl YouTubeUploader { } pub fn create_default_metadata(video_files: &[String], description_file: &str) -> Vec { - let expanded_path = expand_tilde(&description_file); + let expanded_path = expand_tilde(description_file); video_files .iter() - .enumerate() - .map(|(_i, file_path)| { + .map(|file_path| { let filename = Path::new(file_path) .file_stem() .unwrap_or_default() @@ -269,7 +268,7 @@ pub fn create_default_metadata(video_files: &[String], description_file: &str) - .to_string(); VideoMetadata { - title: format!("{}", filename), + title: filename.to_string(), description: get_random_line(&expanded_path).unwrap_or_default(), tags: vec!["gaming".to_string()], category_id: "20".to_string(), // GAMING