diff options
author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-08-23 13:11:09 +0200 |
---|---|---|
committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2024-08-23 13:14:13 +0200 |
commit | 94c656ad40a7aae570e5a5fb61ad32632acc6d46 (patch) | |
tree | 269614af20caf10d76643c302e0115bd36fd2378 /src/select | |
parent | refactor(yt_dlp): Also move the `crates` subdirectory (diff) | |
download | yt-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/select')
-rw-r--r-- | src/select/mod.rs | 9 | ||||
-rw-r--r-- | src/select/selection_file/display.rs | 2 |
2 files changed, 4 insertions, 7 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); diff --git a/src/select/selection_file/display.rs b/src/select/selection_file/display.rs index 12d128c..0a0ce96 100644 --- a/src/select/selection_file/display.rs +++ b/src/select/selection_file/display.rs @@ -32,7 +32,7 @@ impl Video { let opts = get_video_opts(app, &self.extractor_hash) .await? - .to_cli_flags(); + .to_cli_flags(&app); let opts_white = if !opts.is_empty() { " " } else { "" }; let publish_date = if let Some(date) = self.publish_date { |