about summary refs log tree commit diff stats
path: root/src/storage/video_database/setters.rs
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-08-23 13:11:09 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-08-23 13:14:13 +0200
commit94c656ad40a7aae570e5a5fb61ad32632acc6d46 (patch)
tree269614af20caf10d76643c302e0115bd36fd2378 /src/storage/video_database/setters.rs
parentrefactor(yt_dlp): Also move the `crates` subdirectory (diff)
downloadyt-94c656ad40a7aae570e5a5fb61ad32632acc6d46.tar.gz
yt-94c656ad40a7aae570e5a5fb61ad32632acc6d46.zip
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.
Diffstat (limited to 'src/storage/video_database/setters.rs')
-rw-r--r--src/storage/video_database/setters.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/storage/video_database/setters.rs b/src/storage/video_database/setters.rs
index 42875ce..e2b38e6 100644
--- a/src/storage/video_database/setters.rs
+++ b/src/storage/video_database/setters.rs
@@ -16,7 +16,10 @@ use log::debug;
 use sqlx::query;
 use tokio::fs;
 
-use crate::{app::App, constants, storage::video_database::extractor_hash::ExtractorHash};
+use crate::{
+    app::App,
+    storage::video_database::extractor_hash::ExtractorHash,
+};
 
 use super::{Video, VideoOptions, VideoStatus};
 
@@ -213,8 +216,8 @@ pub async fn add_video(app: &App, video: Video) -> Result<()> {
     let url = video.url.to_string();
     let extractor_hash = video.extractor_hash.hash().to_string();
 
-    let default_subtitle_langs = constants::DEFAULT_SUBTITLE_LANGS;
-    let default_mpv_playback_speed = constants::DEFAULT_MPV_PLAYBACK_SPEED;
+    let default_subtitle_langs = &app.config.select.subtitle_langs;
+    let default_mpv_playback_speed = app.config.select.playback_speed;
 
     query!(
         r#"