about summary refs log tree commit diff stats
path: root/src/select/mod.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/select/mod.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 '')
-rw-r--r--src/select/mod.rs9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/select/mod.rs b/src/select/mod.rs
index 6774ce6..2288e1a 100644
--- a/src/select/mod.rs
+++ b/src/select/mod.rs
@@ -18,7 +18,7 @@ use std::{
 use crate::{
     app::App,
     cli::CliArgs,
-    constants::{last_select, HELP_STR},
+    constants::HELP_STR,
     storage::video_database::{getters::get_videos, VideoStatus},
 };
 
@@ -111,11 +111,8 @@ pub async fn select(app: &App, done: bool) -> Result<()> {
     }
 
     let read_file = temp_file.reopen()?;
-    fs::copy(
-        temp_file.path(),
-        last_select().context("Failed to get the persistent selection file path")?,
-    )
-    .context("Failed to persist selection file")?;
+    fs::copy(temp_file.path(), &app.config.paths.last_selection_path)
+        .context("Failed to persist selection file")?;
 
     let reader = BufReader::new(&read_file);