From 94c656ad40a7aae570e5a5fb61ad32632acc6d46 Mon Sep 17 00:00:00 2001 From: Benedikt Peetz Date: Fri, 23 Aug 2024 13:11:09 +0200 Subject: feat(treewide): Use a configuration file This allows use to avoid duplication of default values in the codebase and obviously also facilitates changing these without having to re-compile. --- src/download/download_options.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/download/download_options.rs') 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 { +pub fn download_opts( + app: &App, + additional_opts: YtDlpOptions, +) -> serde_json::Map { match json!({ "extract_flat": false, "extractor_args": { @@ -50,7 +53,7 @@ pub fn download_opts(additional_opts: YtDlpOptions) -> serde_json::Map