about summary refs log tree commit diff stats
path: root/src/download/download_options.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/download/download_options.rs')
-rw-r--r--src/download/download_options.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/download/download_options.rs b/src/download/download_options.rs
index 04c1600..e93170a 100644
--- a/src/download/download_options.rs
+++ b/src/download/download_options.rs
@@ -10,7 +10,7 @@
 
 use serde_json::{json, Value};
 
-use crate::{constants, storage::video_database::YtDlpOptions};
+use crate::{app::App, storage::video_database::YtDlpOptions};
 
 // {
 //     "ratelimit": conf.ratelimit if conf.ratelimit > 0 else None,
@@ -22,7 +22,10 @@ use crate::{constants, storage::video_database::YtDlpOptions};
 //     "logger": _ytdl_logger
 // }
 
-pub fn download_opts(additional_opts: YtDlpOptions) -> serde_json::Map<String, serde_json::Value> {
+pub fn download_opts(
+    app: &App,
+    additional_opts: YtDlpOptions,
+) -> serde_json::Map<String, serde_json::Value> {
     match json!({
       "extract_flat": false,
       "extractor_args": {
@@ -50,7 +53,7 @@ pub fn download_opts(additional_opts: YtDlpOptions) -> serde_json::Map<String, s
       "writeautomaticsub": true,
 
       "outtmpl": {
-        "default": constants::download_dir(false).expect("We're not creating this dir, thus this function can't error").join("%(channel)s/%(title)s.%(ext)s"),
+        "default": app.config.paths.download_dir.join("%(channel)s/%(title)s.%(ext)s"),
         "chapter": "%(title)s - %(section_number)03d %(section_title)s [%(id)s].%(ext)s"
       },
       "compat_opts": {},