Skip to content

Commit 2b5ca6d

Browse files
committed
fixes #3
and some minor bugs
1 parent c2aae19 commit 2b5ca6d

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

src/lib/db.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ pub fn set_query_code(pool: & MyPool, code: &i8, qid: &i64) -> Result<(), Downlo
8181

8282
/// Update progress steps for db entrys
8383
pub fn update_steps(pool: & pool::MyPool, qid: &i64, step: i32, max_steps: i32, finished: bool){
84-
trace!("Updating steps {} of id {}",step, qid);
84+
trace!("Updating steps to {} for id {}",step, qid);
8585
set_query_state(&pool,qid, &format!("{}|{}", step, max_steps), finished);
8686
}
8787

src/lib/downloader.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,11 @@ impl<'a> Downloader<'a>{
408408
if CONFIG.extensions.webm.contains(&self.ddb.quality) {
409409
CONFIG.codecs.yt.audio_normal_webm.to_string()
410410
}else{
411-
CONFIG.codecs.yt.audio_normal_mp4.to_string()
411+
if self.ddb.quality == CONFIG.codecs.audio_source_hq {
412+
CONFIG.codecs.yt.audio_hq.to_string()
413+
} else {
414+
CONFIG.codecs.yt.audio_normal_mp4.to_string()
415+
}
412416
}
413417
}else{
414418
self.ddb.quality.to_string()

src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ fn handle_download<'a>(downl_db: &DownloadDB, folder: &Option<String>, converter
216216
}
217217

218218
//download first file, download audio raw source if specified or video
219-
match download.download_file(&temp_path, convert_audio) {
219+
match download.download_file(&temp_path, download.is_audio()) {
220220
Err(e) => {file_db.pop(); return Err(e); },
221221
Ok(_) => (),
222222
}
@@ -260,7 +260,7 @@ fn handle_download<'a>(downl_db: &DownloadDB, folder: &Option<String>, converter
260260
if !downl_db.compress {
261261
db::update_steps(downl_db.pool,&downl_db.qid, total_steps, total_steps, false);
262262
}
263-
try!(converter.extract_audio(&temp_path, &save_path.to_string_lossy(), convert_audio));
263+
try!(converter.extract_audio(&downl_db.qid, &temp_path, &save_path.to_string_lossy(), convert_audio));
264264
try!(remove_file(&temp_path));
265265
}else{
266266
debug!("no audio");

0 commit comments

Comments
 (0)