diff options
| author | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-05-26 18:30:03 +0200 |
|---|---|---|
| committer | Benedikt Peetz <benedikt.peetz@b-peetz.de> | 2026-05-26 18:30:03 +0200 |
| commit | 45d11a8bde6cbd853b75e05f2b3fb718593ee8ea (patch) | |
| tree | 397646665b297d613dff384d1d192d30aa1b727a /crates | |
| parent | feat(yt/select/file): Allow sorting the videos by other things then priority (diff) | |
| download | yt-45d11a8bde6cbd853b75e05f2b3fb718593ee8ea.zip | |
style(yt/config): Format
Diffstat (limited to 'crates')
| -rw-r--r-- | crates/yt/src/config/mod.rs | 12 | ||||
| -rw-r--r-- | crates/yt/src/storage/db/insert/playlist.rs | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/crates/yt/src/config/mod.rs b/crates/yt/src/config/mod.rs index 24866eb..6e596de 100644 --- a/crates/yt/src/config/mod.rs +++ b/crates/yt/src/config/mod.rs @@ -48,7 +48,8 @@ mk_config! { struct Config { global: GlobalConfig = { /// Whether to display colors. - display_colors: bool where display_color: Option<bool> =! {|config_value: Option<bool>| + display_colors: bool where display_color: Option<bool> =! { + |config_value: Option<bool>| Ok::<_, anyhow::Error>( display_color .unwrap_or( @@ -121,8 +122,13 @@ mk_config! { mpv_ipc_socket_path: PathBuf =? get_runtime_path("mpv.ipc.socket") => ensure_parent_dir, /// Path to the video database. - database_path: PathBuf where db_path: Option<PathBuf> =! {|config_value: Option<PathBuf>| { - db_path.map_or_else(|| config_value.map_or_else(|| get_data_path("videos.sqlite"), Ok), Ok) + database_path: PathBuf where db_path: Option<PathBuf> =! { + |config_value: Option<PathBuf>| { + db_path + .map_or_else( + || config_value.map_or_else(|| get_data_path("videos.sqlite"), Ok), + Ok + ) }} => ensure_parent_dir, /// Where to store the selection file before applying it. diff --git a/crates/yt/src/storage/db/insert/playlist.rs b/crates/yt/src/storage/db/insert/playlist.rs index 4d3e140..26d5376 100644 --- a/crates/yt/src/storage/db/insert/playlist.rs +++ b/crates/yt/src/storage/db/insert/playlist.rs @@ -40,7 +40,7 @@ impl Playlist { ) -> Result<()> { let (current_index, current_video) = self .get_focused_mut() - .expect("This should be some at this point"); + .expect("This should be some at this point"); // TODO: This expectation doesn't hold, if the video is marked as dropped before it is `quit`ed in the `yt watch` <2026-05-13> debug!( "Playlist handler will mark video '{}' {:?}.", |
