about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-02-16 18:21:02 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-02-16 18:21:02 +0100
commit55a94110287ad2b1a55953febac48422a9d3ba89 (patch)
treeca57ff2df49383e3f34a31df8c7c7e3d06470ba1
parentrefactor(yt/): Use the new `termsize` and `uu_fmt` crates (diff)
downloadyt-55a94110287ad2b1a55953febac48422a9d3ba89.zip
style(treewide): Re-format
-rw-r--r--crates/libmpv2/examples/events.rs34
-rw-r--r--crates/libmpv2/examples/opengl.rs19
-rw-r--r--crates/libmpv2/src/lib.rs2
-rw-r--r--crates/libmpv2/src/mpv.rs2
-rw-r--r--crates/libmpv2/src/mpv/errors.rs70
-rw-r--r--crates/libmpv2/src/mpv/events.rs2
-rw-r--r--crates/libmpv2/src/mpv/protocol.rs8
-rw-r--r--crates/libmpv2/src/mpv/render.rs4
-rw-r--r--crates/libmpv2/src/tests.rs24
-rw-r--r--crates/termsize/src/nix.rs2
-rw-r--r--crates/termsize/src/win.rs2
-rw-r--r--crates/yt_dlp/src/lib.rs6
-rw-r--r--crates/yt_dlp/src/logging.rs5
-rw-r--r--crates/yt_dlp/src/tests.rs2
-rw-r--r--crates/yt_dlp/src/wrapper/info_json.rs2
-rw-r--r--crates/yt_dlp/src/wrapper/yt_dlp_options.rs2
-rw-r--r--yt/src/app.rs2
-rw-r--r--yt/src/cache/mod.rs9
-rw-r--r--yt/src/comments/mod.rs4
-rw-r--r--yt/src/comments/output.rs2
-rw-r--r--yt/src/config/default.rs2
-rw-r--r--yt/src/config/file_system.rs2
-rw-r--r--yt/src/description/mod.rs6
-rw-r--r--yt/src/download/download_options.rs2
-rw-r--r--yt/src/download/mod.rs21
-rw-r--r--yt/src/main.rs4
-rw-r--r--yt/src/select/cmds/add.rs33
-rw-r--r--yt/src/select/cmds/mod.rs4
-rw-r--r--yt/src/select/mod.rs4
-rw-r--r--yt/src/status/mod.rs2
-rw-r--r--yt/src/storage/subscriptions.rs2
-rw-r--r--yt/src/storage/video_database/extractor_hash.rs2
-rw-r--r--yt/src/storage/video_database/getters.rs6
-rw-r--r--yt/src/subscribe/mod.rs10
-rw-r--r--yt/src/update/mod.rs4
-rw-r--r--yt/src/update/updater.rs7
-rw-r--r--yt/src/videos/display/format_video.rs2
-rw-r--r--yt/src/videos/display/mod.rs2
-rw-r--r--yt/src/videos/mod.rs8
-rw-r--r--yt/src/watch/events/handlers/mod.rs4
-rw-r--r--yt/src/watch/events/mod.rs9
-rw-r--r--yt/src/watch/events/playlist_handler.rs2
-rw-r--r--yt/src/watch/mod.rs29
43 files changed, 210 insertions, 160 deletions
diff --git a/crates/libmpv2/examples/events.rs b/crates/libmpv2/examples/events.rs
index 8f7c79f..e502d5c 100644
--- a/crates/libmpv2/examples/events.rs
+++ b/crates/libmpv2/examples/events.rs
@@ -45,25 +45,27 @@ fn main() -> Result<()> {
             // Trigger `Event::EndFile`.
             mpv.command("playlist-next", &["force"]).unwrap();
         });
-        scope.spawn(move |_| loop {
-            let ev = ev_ctx.wait_event(600.).unwrap_or(Err(Error::Null));
+        scope.spawn(move |_| {
+            loop {
+                let ev = ev_ctx.wait_event(600.).unwrap_or(Err(Error::Null));
 
-            match ev {
-                Ok(Event::EndFile(r)) => {
-                    println!("Exiting! Reason: {:?}", r);
-                    break;
-                }
+                match ev {
+                    Ok(Event::EndFile(r)) => {
+                        println!("Exiting! Reason: {:?}", r);
+                        break;
+                    }
 
-                Ok(Event::PropertyChange {
-                    name: "demuxer-cache-state",
-                    change: PropertyData::Node(mpv_node),
-                    ..
-                }) => {
-                    let ranges = seekable_ranges(mpv_node);
-                    println!("Seekable ranges updated: {:?}", ranges);
+                    Ok(Event::PropertyChange {
+                        name: "demuxer-cache-state",
+                        change: PropertyData::Node(mpv_node),
+                        ..
+                    }) => {
+                        let ranges = seekable_ranges(mpv_node);
+                        println!("Seekable ranges updated: {:?}", ranges);
+                    }
+                    Ok(e) => println!("Event triggered: {:?}", e),
+                    Err(e) => println!("Event errored: {:?}", e),
                 }
-                Ok(e) => println!("Event triggered: {:?}", e),
-                Err(e) => println!("Event errored: {:?}", e),
             }
         });
     })
diff --git a/crates/libmpv2/examples/opengl.rs b/crates/libmpv2/examples/opengl.rs
index 1de307f..8eb9647 100644
--- a/crates/libmpv2/examples/opengl.rs
+++ b/crates/libmpv2/examples/opengl.rs
@@ -9,8 +9,8 @@
 // If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
 
 use libmpv2::{
-    render::{OpenGLInitParams, RenderContext, RenderParam, RenderParamApiType},
     Mpv,
+    render::{OpenGLInitParams, RenderContext, RenderParam, RenderParamApiType},
 };
 use std::{env, ffi::c_void};
 
@@ -38,16 +38,13 @@ fn main() {
         Ok(())
     })
     .unwrap();
-    let mut render_context = RenderContext::new(
-        unsafe { mpv.ctx.as_mut() },
-        vec![
-            RenderParam::ApiType(RenderParamApiType::OpenGl),
-            RenderParam::InitParams(OpenGLInitParams {
-                get_proc_address,
-                ctx: video,
-            }),
-        ],
-    )
+    let mut render_context = RenderContext::new(unsafe { mpv.ctx.as_mut() }, vec![
+        RenderParam::ApiType(RenderParamApiType::OpenGl),
+        RenderParam::InitParams(OpenGLInitParams {
+            get_proc_address,
+            ctx: video,
+        }),
+    ])
     .expect("Failed creating render context");
 
     event_subsystem
diff --git a/crates/libmpv2/src/lib.rs b/crates/libmpv2/src/lib.rs
index 4d8d18a..d47e620 100644
--- a/crates/libmpv2/src/lib.rs
+++ b/crates/libmpv2/src/lib.rs
@@ -67,8 +67,8 @@ pub mod mpv_error {
     pub use libmpv2_sys::mpv_error_MPV_ERROR_INVALID_PARAMETER as InvalidParameter;
     pub use libmpv2_sys::mpv_error_MPV_ERROR_LOADING_FAILED as LoadingFailed;
     pub use libmpv2_sys::mpv_error_MPV_ERROR_NOMEM as NoMem;
-    pub use libmpv2_sys::mpv_error_MPV_ERROR_NOTHING_TO_PLAY as NothingToPlay;
     pub use libmpv2_sys::mpv_error_MPV_ERROR_NOT_IMPLEMENTED as NotImplemented;
+    pub use libmpv2_sys::mpv_error_MPV_ERROR_NOTHING_TO_PLAY as NothingToPlay;
     pub use libmpv2_sys::mpv_error_MPV_ERROR_OPTION_ERROR as OptionError;
     pub use libmpv2_sys::mpv_error_MPV_ERROR_OPTION_FORMAT as OptionFormat;
     pub use libmpv2_sys::mpv_error_MPV_ERROR_OPTION_NOT_FOUND as OptionNotFound;
diff --git a/crates/libmpv2/src/mpv.rs b/crates/libmpv2/src/mpv.rs
index 6f26d0f..7ac1b43 100644
--- a/crates/libmpv2/src/mpv.rs
+++ b/crates/libmpv2/src/mpv.rs
@@ -184,7 +184,7 @@ pub mod mpv_node {
 
     pub mod sys_node {
         use super::{DropWrapper, MpvNode, MpvNodeArrayIter, MpvNodeMapIter};
-        use crate::{mpv_error, mpv_format, Error, Result};
+        use crate::{Error, Result, mpv_error, mpv_format};
         use std::rc::Rc;
 
         #[derive(Debug, Clone)]
diff --git a/crates/libmpv2/src/mpv/errors.rs b/crates/libmpv2/src/mpv/errors.rs
index 4b28fb3..a2d3dd8 100644
--- a/crates/libmpv2/src/mpv/errors.rs
+++ b/crates/libmpv2/src/mpv/errors.rs
@@ -39,10 +39,17 @@ impl Display for Error {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         match self {
             Error::Loadfile { error } => write!(f, "loading file failed: {error}"),
-            Error::VersionMismatch { linked, loaded } => write!(f, "version mismatch detected! Linked version ({linked}) is unequal to the loaded version ({loaded})"),
+            Error::VersionMismatch { linked, loaded } => write!(
+                f,
+                "version mismatch detected! Linked version ({linked}) is unequal to the loaded version ({loaded})"
+            ),
             Error::InvalidUtf8 => f.write_str("invalid utf8 returned"),
             Error::Null => f.write_str("null pointer returned"),
-            Error::Raw(raw) => write!(f, include_str!("./raw_error_warning.txt"), to_string_mpv_error(*(raw))),
+            Error::Raw(raw) => write!(
+                f,
+                include_str!("./raw_error_warning.txt"),
+                to_string_mpv_error(*(raw))
+            ),
         }
     }
 }
@@ -85,35 +92,70 @@ fn to_string_mpv_error_raw(num: crate::MpvError) -> (&'static str, &'static str)
 
         mpv_error::NoMem => ("Memory allocation failed.", ""),
 
-        mpv_error::Uninitialized => ("The mpv core wasn't configured and initialized yet", " See the notes in mpv_create()."),
+        mpv_error::Uninitialized => (
+            "The mpv core wasn't configured and initialized yet",
+            " See the notes in mpv_create().",
+        ),
 
-        mpv_error::InvalidParameter => ("Generic catch-all error if a parameter is set to an invalid or unsupported value.", "This is used if there is no better error code."),
+        mpv_error::InvalidParameter => (
+            "Generic catch-all error if a parameter is set to an invalid or unsupported value.",
+            "This is used if there is no better error code.",
+        ),
 
         mpv_error::OptionNotFound => ("Trying to set an option that doesn't exist.", ""),
-        mpv_error::OptionFormat => ("Trying to set an option using an unsupported MPV_FORMAT.", ""),
-        mpv_error::OptionError => ("Setting the option failed", " Typically this happens if the provided option value could not be parsed."),
+        mpv_error::OptionFormat => (
+            "Trying to set an option using an unsupported MPV_FORMAT.",
+            "",
+        ),
+        mpv_error::OptionError => (
+            "Setting the option failed",
+            " Typically this happens if the provided option value could not be parsed.",
+        ),
 
         mpv_error::PropertyNotFound => ("The accessed property doesn't exist.", ""),
-        mpv_error::PropertyFormat => ("Trying to set or get a property using an unsupported MPV_FORMAT.", ""),
-        mpv_error::PropertyUnavailable => ("The property exists, but is not available", "This usually happens when the associated subsystem is not active, e.g. querying audio parameters while audio is disabled."),
+        mpv_error::PropertyFormat => (
+            "Trying to set or get a property using an unsupported MPV_FORMAT.",
+            "",
+        ),
+        mpv_error::PropertyUnavailable => (
+            "The property exists, but is not available",
+            "This usually happens when the associated subsystem is not active, e.g. querying audio parameters while audio is disabled.",
+        ),
         mpv_error::PropertyError => ("Error setting or getting a property.", ""),
 
-        mpv_error::Command => ("General error when running a command with mpv_command and similar.", ""),
+        mpv_error::Command => (
+            "General error when running a command with mpv_command and similar.",
+            "",
+        ),
 
-        mpv_error::LoadingFailed => ("Generic error on loading (usually used with mpv_event_end_file.error).", ""),
+        mpv_error::LoadingFailed => (
+            "Generic error on loading (usually used with mpv_event_end_file.error).",
+            "",
+        ),
 
         mpv_error::AoInitFailed => ("Initializing the audio output failed.", ""),
         mpv_error::VoInitFailed => ("Initializing the video output failed.", ""),
 
-        mpv_error::NothingToPlay => ("There was no audio or video data to play", "This also happens if the file was recognized, but did not contain any audio or video streams, or no streams were selected."),
+        mpv_error::NothingToPlay => (
+            "There was no audio or video data to play",
+            "This also happens if the file was recognized, but did not contain any audio or video streams, or no streams were selected.",
+        ),
 
-        mpv_error::UnknownFormat => ("     * When trying to load the file, the file format could not be determined, or the file was too broken to open it.", ""),
+        mpv_error::UnknownFormat => (
+            "     * When trying to load the file, the file format could not be determined, or the file was too broken to open it.",
+            "",
+        ),
 
-        mpv_error::Generic => ("Generic error for signaling that certain system requirements are not fulfilled.", ""),
+        mpv_error::Generic => (
+            "Generic error for signaling that certain system requirements are not fulfilled.",
+            "",
+        ),
         mpv_error::NotImplemented => ("The API function which was called is a stub only", ""),
         mpv_error::Unsupported => ("Unspecified error.", ""),
 
-        mpv_error::Success => unreachable!("This is not an error. It's just here, to ensure that the 0 case marks an success'"),
+        mpv_error::Success => unreachable!(
+            "This is not an error. It's just here, to ensure that the 0 case marks an success'"
+        ),
         _ => unreachable!("Mpv seems to have changed it's constants."),
     }
 }
diff --git a/crates/libmpv2/src/mpv/events.rs b/crates/libmpv2/src/mpv/events.rs
index 6fb4683..ea105d4 100644
--- a/crates/libmpv2/src/mpv/events.rs
+++ b/crates/libmpv2/src/mpv/events.rs
@@ -11,7 +11,7 @@
 use crate::mpv_node::sys_node::SysMpvNode;
 use crate::{mpv::mpv_err, *};
 
-use std::ffi::{c_void, CString};
+use std::ffi::{CString, c_void};
 use std::os::raw as ctype;
 use std::ptr::NonNull;
 use std::slice;
diff --git a/crates/libmpv2/src/mpv/protocol.rs b/crates/libmpv2/src/mpv/protocol.rs
index 31a5933..c4f0e2f 100644
--- a/crates/libmpv2/src/mpv/protocol.rs
+++ b/crates/libmpv2/src/mpv/protocol.rs
@@ -17,7 +17,7 @@ use std::os::raw as ctype;
 use std::panic;
 use std::panic::RefUnwindSafe;
 use std::slice;
-use std::sync::{atomic::Ordering, Mutex};
+use std::sync::{Mutex, atomic::Ordering};
 
 impl Mpv {
     /// Create a context with which custom protocols can be registered.
@@ -101,11 +101,7 @@ where
         let slice = slice::from_raw_parts_mut(buf, nbytes as _);
         ((*data).read_fn)(&mut *(*data).cookie, slice)
     });
-    if let Ok(ret) = ret {
-        ret
-    } else {
-        -1
-    }
+    if let Ok(ret) = ret { ret } else { -1 }
 }
 
 unsafe extern "C" fn seek_wrapper<T, U>(cookie: *mut ctype::c_void, offset: i64) -> i64
diff --git a/crates/libmpv2/src/mpv/render.rs b/crates/libmpv2/src/mpv/render.rs
index c3f2dc9..6457048 100644
--- a/crates/libmpv2/src/mpv/render.rs
+++ b/crates/libmpv2/src/mpv/render.rs
@@ -8,9 +8,9 @@
 // You should have received a copy of the License along with this program.
 // If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
 
-use crate::{mpv::mpv_err, Error, Result};
+use crate::{Error, Result, mpv::mpv_err};
 use std::collections::HashMap;
-use std::ffi::{c_void, CStr};
+use std::ffi::{CStr, c_void};
 use std::os::raw::c_int;
 use std::ptr;
 
diff --git a/crates/libmpv2/src/tests.rs b/crates/libmpv2/src/tests.rs
index 68753fc..6106eb2 100644
--- a/crates/libmpv2/src/tests.rs
+++ b/crates/libmpv2/src/tests.rs
@@ -54,10 +54,10 @@ fn properties() {
         0.6,
         f64::round(subg * f64::powi(10.0, 4)) / f64::powi(10.0, 4)
     );
-    mpv.command(
-        "loadfile",
-        &["test-data/speech_12kbps_mb.wav", "append-play"],
-    )
+    mpv.command("loadfile", &[
+        "test-data/speech_12kbps_mb.wav",
+        "append-play",
+    ])
     .unwrap();
     thread::sleep(Duration::from_millis(250));
 
@@ -185,10 +185,10 @@ fn events() {
 fn node_map() {
     let mpv = Mpv::new().unwrap();
 
-    mpv.command(
-        "loadfile",
-        &["test-data/speech_12kbps_mb.wav", "append-play"],
-    )
+    mpv.command("loadfile", &[
+        "test-data/speech_12kbps_mb.wav",
+        "append-play",
+    ])
     .unwrap();
 
     thread::sleep(Duration::from_millis(250));
@@ -217,10 +217,10 @@ fn node_map() {
 fn node_array() -> Result<()> {
     let mpv = Mpv::new()?;
 
-    mpv.command(
-        "loadfile",
-        &["test-data/speech_12kbps_mb.wav", "append-play"],
-    )
+    mpv.command("loadfile", &[
+        "test-data/speech_12kbps_mb.wav",
+        "append-play",
+    ])
     .unwrap();
 
     thread::sleep(Duration::from_millis(250));
diff --git a/crates/termsize/src/nix.rs b/crates/termsize/src/nix.rs
index e35aa6b..d672f54 100644
--- a/crates/termsize/src/nix.rs
+++ b/crates/termsize/src/nix.rs
@@ -11,7 +11,7 @@
 use std::io::IsTerminal;
 
 use self::super::Size;
-use libc::{c_ushort, ioctl, STDOUT_FILENO, TIOCGWINSZ};
+use libc::{STDOUT_FILENO, TIOCGWINSZ, c_ushort, ioctl};
 
 /// A representation of the size of the current terminal
 #[repr(C)]
diff --git a/crates/termsize/src/win.rs b/crates/termsize/src/win.rs
index 666a0fc..72d8433 100644
--- a/crates/termsize/src/win.rs
+++ b/crates/termsize/src/win.rs
@@ -13,7 +13,7 @@ use std::ptr;
 use winapi::um::{
     fileapi::{CreateFileA, OPEN_EXISTING},
     handleapi::INVALID_HANDLE_VALUE,
-    wincon::{GetConsoleScreenBufferInfo, CONSOLE_SCREEN_BUFFER_INFO},
+    wincon::{CONSOLE_SCREEN_BUFFER_INFO, GetConsoleScreenBufferInfo},
     winnt::{FILE_SHARE_WRITE, GENERIC_READ, GENERIC_WRITE},
 };
 
diff --git a/crates/yt_dlp/src/lib.rs b/crates/yt_dlp/src/lib.rs
index 129d4db..40610c2 100644
--- a/crates/yt_dlp/src/lib.rs
+++ b/crates/yt_dlp/src/lib.rs
@@ -22,12 +22,12 @@ use crate::{duration::Duration, logging::setup_logging, wrapper::info_json::Info
 
 use bytes::Bytes;
 use error::YtDlpError;
-use log::{debug, info, log_enabled, Level};
+use log::{Level, debug, info, log_enabled};
 use pyo3::types::{PyString, PyTuple, PyTupleMethods};
 use pyo3::{
-    pyfunction,
+    Bound, PyAny, PyResult, Python, pyfunction,
     types::{PyAnyMethods, PyDict, PyDictMethods, PyList, PyListMethods, PyModule},
-    wrap_pyfunction, Bound, PyAny, PyResult, Python,
+    wrap_pyfunction,
 };
 use serde::Serialize;
 use serde_json::{Map, Value};
diff --git a/crates/yt_dlp/src/logging.rs b/crates/yt_dlp/src/logging.rs
index 670fc1c..e731502 100644
--- a/crates/yt_dlp/src/logging.rs
+++ b/crates/yt_dlp/src/logging.rs
@@ -17,10 +17,11 @@
 
 use std::ffi::CString;
 
-use log::{logger, Level, MetadataBuilder, Record};
+use log::{Level, MetadataBuilder, Record, logger};
 use pyo3::{
+    Bound, PyAny, PyResult, Python,
     prelude::{PyAnyMethods, PyListMethods, PyModuleMethods},
-    pyfunction, wrap_pyfunction, Bound, PyAny, PyResult, Python,
+    pyfunction, wrap_pyfunction,
 };
 
 /// Consume a Python `logging.LogRecord` and emit a Rust `Log` instead.
diff --git a/crates/yt_dlp/src/tests.rs b/crates/yt_dlp/src/tests.rs
index b072348..91b6626 100644
--- a/crates/yt_dlp/src/tests.rs
+++ b/crates/yt_dlp/src/tests.rs
@@ -10,7 +10,7 @@
 
 use std::sync::LazyLock;
 
-use serde_json::{json, Value};
+use serde_json::{Value, json};
 use url::Url;
 
 static YT_OPTS: LazyLock<serde_json::Map<String, Value>> = LazyLock::new(|| {
diff --git a/crates/yt_dlp/src/wrapper/info_json.rs b/crates/yt_dlp/src/wrapper/info_json.rs
index 720740c..4b80245 100644
--- a/crates/yt_dlp/src/wrapper/info_json.rs
+++ b/crates/yt_dlp/src/wrapper/info_json.rs
@@ -13,7 +13,7 @@
 
 use std::{collections::HashMap, path::PathBuf};
 
-use pyo3::{types::PyDict, Bound, PyResult, Python};
+use pyo3::{Bound, PyResult, Python, types::PyDict};
 use serde::{Deserialize, Deserializer, Serialize};
 use serde_json::Value;
 use url::Url;
diff --git a/crates/yt_dlp/src/wrapper/yt_dlp_options.rs b/crates/yt_dlp/src/wrapper/yt_dlp_options.rs
index c2a86df..25595b5 100644
--- a/crates/yt_dlp/src/wrapper/yt_dlp_options.rs
+++ b/crates/yt_dlp/src/wrapper/yt_dlp_options.rs
@@ -8,7 +8,7 @@
 // You should have received a copy of the License along with this program.
 // If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
 
-use pyo3::{types::PyDict, Bound, PyResult, Python};
+use pyo3::{Bound, PyResult, Python, types::PyDict};
 use serde::Serialize;
 
 use crate::json_loads;
diff --git a/yt/src/app.rs b/yt/src/app.rs
index 1f82214..b9338af 100644
--- a/yt/src/app.rs
+++ b/yt/src/app.rs
@@ -9,7 +9,7 @@
 // If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
 
 use anyhow::{Context, Result};
-use sqlx::{query, sqlite::SqliteConnectOptions, SqlitePool};
+use sqlx::{SqlitePool, query, sqlite::SqliteConnectOptions};
 
 use crate::config::Config;
 
diff --git a/yt/src/cache/mod.rs b/yt/src/cache/mod.rs
index dfbc276..e3dfda2 100644
--- a/yt/src/cache/mod.rs
+++ b/yt/src/cache/mod.rs
@@ -15,8 +15,8 @@ use tokio::fs;
 use crate::{
     app::App,
     storage::video_database::{
-        downloader::set_video_cache_path, getters::get_videos, setters::set_state_change, Video,
-        VideoStatus,
+        Video, VideoStatus, downloader::set_video_cache_path, getters::get_videos,
+        setters::set_state_change,
     },
 };
 
@@ -91,7 +91,10 @@ pub async fn maintain(app: &App, all: bool) -> Result<()> {
             }
         }
         if vid.status_change {
-            info!("Video '{}' has it's changing bit set. This is probably the result of an unexpectet exit. Clearing it", vid.title);
+            info!(
+                "Video '{}' has it's changing bit set. This is probably the result of an unexpectet exit. Clearing it",
+                vid.title
+            );
             set_state_change(app, &vid.extractor_hash, false).await?;
         }
     }
diff --git a/yt/src/comments/mod.rs b/yt/src/comments/mod.rs
index afc90de..97b2c24 100644
--- a/yt/src/comments/mod.rs
+++ b/yt/src/comments/mod.rs
@@ -10,7 +10,7 @@
 
 use std::mem;
 
-use anyhow::{bail, Context, Result};
+use anyhow::{Context, Result, bail};
 use comment::{CommentExt, Comments};
 use output::display_fmt_and_less;
 use regex::Regex;
@@ -19,8 +19,8 @@ use yt_dlp::wrapper::info_json::{Comment, InfoJson, Parent};
 use crate::{
     app::App,
     storage::video_database::{
-        getters::{get_currently_playing_video, get_video_info_json},
         Video,
+        getters::{get_currently_playing_video, get_video_info_json},
     },
     unreachable::Unreachable,
 };
diff --git a/yt/src/comments/output.rs b/yt/src/comments/output.rs
index c279e9e..9b3d684 100644
--- a/yt/src/comments/output.rs
+++ b/yt/src/comments/output.rs
@@ -14,7 +14,7 @@ use std::{
 };
 
 use anyhow::{Context, Result};
-use uu_fmt::{process_text, FmtOptions};
+use uu_fmt::{FmtOptions, process_text};
 
 use crate::unreachable::Unreachable;
 
diff --git a/yt/src/config/default.rs b/yt/src/config/default.rs
index 7c61d6d..9f33001 100644
--- a/yt/src/config/default.rs
+++ b/yt/src/config/default.rs
@@ -77,7 +77,7 @@ pub(crate) mod paths {
 
     use anyhow::Result;
 
-    use super::{create_path, get_config_path, get_data_path, get_runtime_path, PREFIX};
+    use super::{PREFIX, create_path, get_config_path, get_data_path, get_runtime_path};
 
     // We download to the temp dir to avoid taxing the disk
     pub(crate) fn download_dir() -> Result<PathBuf> {
diff --git a/yt/src/config/file_system.rs b/yt/src/config/file_system.rs
index 49e02fe..0755aee 100644
--- a/yt/src/config/file_system.rs
+++ b/yt/src/config/file_system.rs
@@ -11,8 +11,8 @@
 use crate::config::{DownloadConfig, PathsConfig, SelectConfig, WatchConfig};
 
 use super::{
-    default::{create_path, download, global, paths, select, update, watch},
     Config, GlobalConfig, UpdateConfig,
+    default::{create_path, download, global, paths, select, update, watch},
 };
 
 use std::{fs::read_to_string, path::PathBuf};
diff --git a/yt/src/description/mod.rs b/yt/src/description/mod.rs
index 10f0e0c..f31c027 100644
--- a/yt/src/description/mod.rs
+++ b/yt/src/description/mod.rs
@@ -9,16 +9,16 @@
 // If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
 
 use crate::{
+    App,
     comments::output::display_fmt_and_less,
     storage::video_database::{
-        getters::{get_currently_playing_video, get_video_info_json},
         Video,
+        getters::{get_currently_playing_video, get_video_info_json},
     },
     unreachable::Unreachable,
-    App,
 };
 
-use anyhow::{bail, Result};
+use anyhow::{Result, bail};
 use yt_dlp::wrapper::info_json::InfoJson;
 
 pub async fn description(app: &App) -> Result<()> {
diff --git a/yt/src/download/download_options.rs b/yt/src/download/download_options.rs
index bb87214..0d28553 100644
--- a/yt/src/download/download_options.rs
+++ b/yt/src/download/download_options.rs
@@ -8,7 +8,7 @@
 // You should have received a copy of the License along with this program.
 // If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
 
-use serde_json::{json, Value};
+use serde_json::{Value, json};
 
 use crate::{app::App, storage::video_database::YtDlpOptions};
 
diff --git a/yt/src/download/mod.rs b/yt/src/download/mod.rs
index 8bd8a75..7cfa0b0 100644
--- a/yt/src/download/mod.rs
+++ b/yt/src/download/mod.rs
@@ -14,17 +14,17 @@ use crate::{
     app::App,
     download::download_options::download_opts,
     storage::video_database::{
+        Video, YtDlpOptions,
         downloader::{get_next_uncached_video, set_video_cache_path},
         extractor_hash::ExtractorHash,
         getters::get_video_yt_dlp_opts,
-        Video, YtDlpOptions,
     },
     unreachable::Unreachable,
 };
 
-use anyhow::{bail, Context, Result};
+use anyhow::{Context, Result, bail};
 use bytes::Bytes;
-use futures::{future::BoxFuture, FutureExt};
+use futures::{FutureExt, future::BoxFuture};
 use log::{debug, error, info, warn};
 use tokio::{fs, task::JoinHandle, time};
 
@@ -126,8 +126,11 @@ impl Downloader {
                 warn!(
                     "Can't download video: '{}' ({}) as it's too large for the cache ({} of {} allocated). \
                      Waiting for cache size reduction..",
-                    next_video.title, Bytes::new(video_size), &cache_allocation, Bytes::new(max_cache_size)
-                    );
+                    next_video.title,
+                    Bytes::new(video_size),
+                    &cache_allocation,
+                    Bytes::new(max_cache_size)
+                );
                 self.printed_warning = true;
 
                 // Update this value immediately.
@@ -198,8 +201,12 @@ impl Downloader {
                     self.current_download = Some(current_download);
                 } else {
                     info!(
-                    "Noticed, that the next video is not the video being downloaded, replacing it ('{}' vs. '{}')!",
-                        next_video.extractor_hash.into_short_hash(&app).await?, current_download.extractor_hash.into_short_hash(&app).await?
+                        "Noticed, that the next video is not the video being downloaded, replacing it ('{}' vs. '{}')!",
+                        next_video.extractor_hash.into_short_hash(&app).await?,
+                        current_download
+                            .extractor_hash
+                            .into_short_hash(&app)
+                            .await?
                     );
 
                     // Replace the currently downloading video
diff --git a/yt/src/main.rs b/yt/src/main.rs
index 5b5eda4..acc6c7d 100644
--- a/yt/src/main.rs
+++ b/yt/src/main.rs
@@ -14,7 +14,7 @@
 
 use std::{collections::HashMap, fs, sync::Arc};
 
-use anyhow::{bail, Context, Result};
+use anyhow::{Context, Result, bail};
 use app::App;
 use bytes::Bytes;
 use cache::{invalidate, maintain};
@@ -26,7 +26,7 @@ use select::cmds::handle_select_cmd;
 use storage::video_database::getters::get_video_by_hash;
 use tokio::{
     fs::File,
-    io::{stdin, BufReader},
+    io::{BufReader, stdin},
     task::JoinHandle,
 };
 use url::Url;
diff --git a/yt/src/select/cmds/add.rs b/yt/src/select/cmds/add.rs
index ea39789..7d6da0f 100644
--- a/yt/src/select/cmds/add.rs
+++ b/yt/src/select/cmds/add.rs
@@ -7,8 +7,8 @@ use crate::{
     videos::display::format_video::FormatVideo,
 };
 
-use anyhow::{bail, Context, Result};
-use log::warn;
+use anyhow::{Context, Result, bail};
+use log::{error, warn};
 use serde_json::{Map, Value};
 use url::Url;
 use yt_dlp::wrapper::info_json::InfoType;
@@ -50,12 +50,9 @@ pub(super) async fn add(
             Ok(())
         }
 
-        let opts = download_opts(
-            app,
-            &video_database::YtDlpOptions {
-                subtitle_langs: String::new(),
-            },
-        );
+        let opts = download_opts(app, &video_database::YtDlpOptions {
+            subtitle_langs: String::new(),
+        });
 
         let entry = yt_dlp::extract_info(&opts, &url, false, true)
             .await
@@ -65,7 +62,9 @@ pub(super) async fn add(
             Some(InfoType::Video) => {
                 add_entry(app, entry).await?;
                 if start.is_some() || stop.is_some() {
-                    warn!("You added `start` and `stop` markers for a single /video/! These will be ignored.");
+                    warn!(
+                        "You added `start` and `stop` markers for a single /video/! These will be ignored."
+                    );
                 }
             }
             Some(InfoType::Playlist) => {
@@ -73,12 +72,12 @@ pub(super) async fn add(
                     let start = start.unwrap_or(0);
                     let stop = stop.unwrap_or(entries.len() - 1);
 
-                    let mut respected_entries: Vec<_> =
-                            take_vector(entries, start, stop)
-                                .with_context(|| {
-                                format!(
-                                "Failed to take entries starting at: {start} and ending with {stop}")
-                            })?;
+                    let mut respected_entries: Vec<_> = take_vector(entries, start, stop)
+                        .with_context(|| {
+                            format!(
+                                "Failed to take entries starting at: {start} and ending with {stop}"
+                            )
+                        })?;
 
                     if respected_entries.is_empty() {
                         warn!("No entries found, after applying your start/stop limits.");
@@ -113,7 +112,9 @@ fn take_vector<T>(vector: Vec<T>, start: usize, stop: usize) -> Result<Vec<T>> {
     let length = vector.len();
 
     if stop >= length {
-        bail!("Your stop marker ({stop}) exceeds the possible entries ({length})! Remember that it is zero indexed.");
+        bail!(
+            "Your stop marker ({stop}) exceeds the possible entries ({length})! Remember that it is zero indexed."
+        );
     }
 
     let end_skip = {
diff --git a/yt/src/select/cmds/mod.rs b/yt/src/select/cmds/mod.rs
index 105569b..2a8a44f 100644
--- a/yt/src/select/cmds/mod.rs
+++ b/yt/src/select/cmds/mod.rs
@@ -12,13 +12,13 @@ use crate::{
     app::App,
     cli::{SelectCommand, SharedSelectionCommandArgs},
     storage::video_database::{
+        VideoOptions, VideoStatus,
         getters::get_video_by_hash,
         setters::{set_video_options, set_video_status},
-        VideoOptions, VideoStatus,
     },
 };
 
-use anyhow::{bail, Context, Result};
+use anyhow::{Context, Result, bail};
 
 mod add;
 
diff --git a/yt/src/select/mod.rs b/yt/src/select/mod.rs
index ddc8a5e..e7eb460 100644
--- a/yt/src/select/mod.rs
+++ b/yt/src/select/mod.rs
@@ -19,12 +19,12 @@ use crate::{
     app::App,
     cli::CliArgs,
     constants::HELP_STR,
-    storage::video_database::{getters::get_videos, VideoStatus},
+    storage::video_database::{VideoStatus, getters::get_videos},
     unreachable::Unreachable,
     videos::display::format_video::FormatVideo,
 };
 
-use anyhow::{bail, Context, Result};
+use anyhow::{Context, Result, bail};
 use clap::Parser;
 use cmds::handle_select_cmd;
 use futures::future::join_all;
diff --git a/yt/src/status/mod.rs b/yt/src/status/mod.rs
index 2f493f7..56d29e6 100644
--- a/yt/src/status/mod.rs
+++ b/yt/src/status/mod.rs
@@ -20,7 +20,7 @@ use crate::{
     download::Downloader,
     storage::{
         subscriptions::get,
-        video_database::{getters::get_videos, VideoStatus},
+        video_database::{VideoStatus, getters::get_videos},
     },
 };
 
diff --git a/yt/src/storage/subscriptions.rs b/yt/src/storage/subscriptions.rs
index 8e089f0..f819dc6 100644
--- a/yt/src/storage/subscriptions.rs
+++ b/yt/src/storage/subscriptions.rs
@@ -14,7 +14,7 @@ use std::collections::HashMap;
 
 use anyhow::Result;
 use log::debug;
-use serde_json::{json, Value};
+use serde_json::{Value, json};
 use sqlx::query;
 use url::Url;
 use yt_dlp::wrapper::info_json::InfoType;
diff --git a/yt/src/storage/video_database/extractor_hash.rs b/yt/src/storage/video_database/extractor_hash.rs
index 3aa3cd2..d080f97 100644
--- a/yt/src/storage/video_database/extractor_hash.rs
+++ b/yt/src/storage/video_database/extractor_hash.rs
@@ -10,7 +10,7 @@
 
 use std::{collections::HashSet, fmt::Display, str::FromStr};
 
-use anyhow::{bail, Context, Result};
+use anyhow::{Context, Result, bail};
 use blake3::Hash;
 use log::debug;
 use tokio::sync::OnceCell;
diff --git a/yt/src/storage/video_database/getters.rs b/yt/src/storage/video_database/getters.rs
index d8f9a3f..3470442 100644
--- a/yt/src/storage/video_database/getters.rs
+++ b/yt/src/storage/video_database/getters.rs
@@ -13,10 +13,10 @@
 //! performance or convince requires.
 use std::{fs::File, path::PathBuf};
 
-use anyhow::{bail, Context, Result};
+use anyhow::{Context, Result, bail};
 use blake3::Hash;
 use log::debug;
-use sqlx::{query, QueryBuilder, Row, Sqlite};
+use sqlx::{QueryBuilder, Row, Sqlite, query};
 use url::Url;
 use yt_dlp::wrapper::info_json::InfoJson;
 
@@ -24,7 +24,7 @@ use crate::{
     app::App,
     storage::{
         subscriptions::Subscription,
-        video_database::{extractor_hash::ExtractorHash, Video},
+        video_database::{Video, extractor_hash::ExtractorHash},
     },
     unreachable::Unreachable,
 };
diff --git a/yt/src/subscribe/mod.rs b/yt/src/subscribe/mod.rs
index ef46627..7e5c68f 100644
--- a/yt/src/subscribe/mod.rs
+++ b/yt/src/subscribe/mod.rs
@@ -10,10 +10,10 @@
 
 use std::str::FromStr;
 
-use anyhow::{bail, Context, Result};
+use anyhow::{Context, Result, bail};
 use futures::FutureExt;
 use log::warn;
-use serde_json::{json, Value};
+use serde_json::{Value, json};
 use tokio::io::{AsyncBufRead, AsyncBufReadExt};
 use url::Url;
 use yt_dlp::wrapper::info_json::InfoType;
@@ -21,7 +21,7 @@ use yt_dlp::wrapper::info_json::InfoType;
 use crate::{
     app::App,
     storage::subscriptions::{
-        add_subscription, check_url, get, remove_all, remove_subscription, Subscription,
+        Subscription, add_subscription, check_url, get, remove_all, remove_subscription,
     },
     unreachable::Unreachable,
 };
@@ -76,7 +76,9 @@ pub async fn subscribe(app: &App, name: Option<String>, url: Url) -> Result<()>
         || url.as_str().ends_with("shorts/"))
         && url.as_str().contains("youtube.com")
     {
-        warn!("Your youtbe url does not seem like it actually tracks a channels playlist (videos, streams, shorts). Adding subscriptions for each of them...");
+        warn!(
+            "Your youtbe url does not seem like it actually tracks a channels playlist (videos, streams, shorts). Adding subscriptions for each of them..."
+        );
 
         let url = Url::parse(&(url.as_str().to_owned() + "/"))
             .unreachable("This was an url, it should stay one");
diff --git a/yt/src/update/mod.rs b/yt/src/update/mod.rs
index 730e7c0..9d34498 100644
--- a/yt/src/update/mod.rs
+++ b/yt/src/update/mod.rs
@@ -21,8 +21,8 @@ use crate::{
     storage::{
         subscriptions::{self, Subscription},
         video_database::{
-            extractor_hash::ExtractorHash, getters::get_all_hashes, setters::add_video, Video,
-            VideoStatus,
+            Video, VideoStatus, extractor_hash::ExtractorHash, getters::get_all_hashes,
+            setters::add_video,
         },
     },
     videos::display::format_video::FormatVideo,
diff --git a/yt/src/update/updater.rs b/yt/src/update/updater.rs
index d54def8..70cdecd 100644
--- a/yt/src/update/updater.rs
+++ b/yt/src/update/updater.rs
@@ -1,13 +1,12 @@
-use std::io::{stderr, Write};
+use std::io::{Write, stderr};
 
 use anyhow::{Context, Result};
 use blake3::Hash;
 use futures::{
-    stream::{self},
     StreamExt, TryStreamExt,
+    stream::{self},
 };
-use log::{debug, error, info, log_enabled, Level};
-use owo_colors::OwoColorize;
+use log::{Level, debug, error, log_enabled};
 use serde_json::json;
 use yt_dlp::{error::YtDlpError, process_ie_result, wrapper::info_json::InfoJson};
 
diff --git a/yt/src/videos/display/format_video.rs b/yt/src/videos/display/format_video.rs
index 5c0320a..26f0f5b 100644
--- a/yt/src/videos/display/format_video.rs
+++ b/yt/src/videos/display/format_video.rs
@@ -32,7 +32,7 @@ pub trait FormatVideo {
 
     #[allow(clippy::type_complexity)]
     fn to_parts(
-        &self
+        &self,
     ) -> (
         Self::Output,
         Self::Output,
diff --git a/yt/src/videos/display/mod.rs b/yt/src/videos/display/mod.rs
index 4a32e52..3f03ec0 100644
--- a/yt/src/videos/display/mod.rs
+++ b/yt/src/videos/display/mod.rs
@@ -18,7 +18,7 @@ use url::Url;
 use crate::{
     app::App,
     select::selection_file::duration::Duration,
-    storage::video_database::{getters::get_video_opts, Video},
+    storage::video_database::{Video, getters::get_video_opts},
 };
 
 use anyhow::{Context, Result};
diff --git a/yt/src/videos/mod.rs b/yt/src/videos/mod.rs
index 156d01d..23613f7 100644
--- a/yt/src/videos/mod.rs
+++ b/yt/src/videos/mod.rs
@@ -9,18 +9,18 @@
 // If not, see <https://www.gnu.org/licenses/gpl-3.0.txt>.
 
 use anyhow::Result;
-use display::{format_video::FormatVideo, FormattedVideo};
-use futures::{stream::FuturesUnordered, TryStreamExt};
+use display::{FormattedVideo, format_video::FormatVideo};
+use futures::{TryStreamExt, stream::FuturesUnordered};
 use nucleo_matcher::{
-    pattern::{CaseMatching, Normalization, Pattern},
     Matcher,
+    pattern::{CaseMatching, Normalization, Pattern},
 };
 
 pub mod display;
 
 use crate::{
     app::App,
-    storage::video_database::{getters::get_videos, VideoStatus},
+    storage::video_database::{VideoStatus, getters::get_videos},
 };
 
 pub async fn query(app: &App, limit: Option<usize>, search_query: Option<String>) -> Result<()> {
diff --git a/yt/src/watch/events/handlers/mod.rs b/yt/src/watch/events/handlers/mod.rs
index 3f30812..8d4304b 100644
--- a/yt/src/watch/events/handlers/mod.rs
+++ b/yt/src/watch/events/handlers/mod.rs
@@ -14,10 +14,10 @@ use crate::{app::App, comments, description, storage::video_database::setters::s
 
 use super::MpvEventHandler;
 
-use anyhow::{bail, Context, Result};
+use anyhow::{Context, Result, bail};
 use libmpv2::{
-    events::{EndFileEvent, PlaylistEntryId},
     Mpv,
+    events::{EndFileEvent, PlaylistEntryId},
 };
 use log::info;
 use tokio::process::Command;
diff --git a/yt/src/watch/events/mod.rs b/yt/src/watch/events/mod.rs
index 10e8bc8..7a08610 100644
--- a/yt/src/watch/events/mod.rs
+++ b/yt/src/watch/events/mod.rs
@@ -12,18 +12,18 @@ use std::collections::{HashMap, HashSet};
 
 use anyhow::{Context, Result};
 use libmpv2::{
-    events::{Event, PlaylistEntryId},
     EndFileReason, Mpv,
+    events::{Event, PlaylistEntryId},
 };
 use log::{debug, info};
 
 use crate::{
     app::App,
     storage::video_database::{
+        VideoStatus,
         extractor_hash::ExtractorHash,
         getters::{get_video_by_hash, get_video_mpv_opts, get_videos},
         setters::{set_state_change, set_video_watched},
-        VideoStatus,
     },
     unreachable::Unreachable,
 };
@@ -143,7 +143,10 @@ impl MpvEventHandler {
             let playlist_position = {
                 let raw = mpv.get_property::<i64>("playlist-pos")?;
                 if raw == -1 {
-                    unreachable!("Tried to get the currently playing video hash, but failed to access the mpv 'playlist-pos' property! This is a bug, as this function should only be called, when a current video exists. Current state: '{:#?}'", self);
+                    unreachable!(
+                        "Tried to get the currently playing video hash, but failed to access the mpv 'playlist-pos' property! This is a bug, as this function should only be called, when a current video exists. Current state: '{:#?}'",
+                        self
+                    );
                 } else {
                     usize::try_from(raw + offset).with_context(|| format!("Failed to calculate playlist position because of usize overflow: '{raw} + {offset}'"))?
                 }
diff --git a/yt/src/watch/events/playlist_handler.rs b/yt/src/watch/events/playlist_handler.rs
index 232232d..8565ea8 100644
--- a/yt/src/watch/events/playlist_handler.rs
+++ b/yt/src/watch/events/playlist_handler.rs
@@ -11,7 +11,7 @@
 use std::collections::HashMap;
 
 use anyhow::Result;
-use libmpv2::{events::PlaylistEntryId, mpv_node::MpvNode, Mpv};
+use libmpv2::{Mpv, events::PlaylistEntryId, mpv_node::MpvNode};
 
 use crate::storage::video_database::extractor_hash::ExtractorHash;
 
diff --git a/yt/src/watch/mod.rs b/yt/src/watch/mod.rs
index 7247999..630de68 100644
--- a/yt/src/watch/mod.rs
+++ b/yt/src/watch/mod.rs
@@ -12,14 +12,14 @@ use std::{collections::HashMap, time::Duration};
 
 use anyhow::{Context, Result};
 use events::{IdleCheckOutput, MpvEventHandler};
-use libmpv2::{events::EventContext, Mpv};
+use libmpv2::{Mpv, events::EventContext};
 use log::{debug, info, trace, warn};
 use tokio::time;
 
 use crate::{
     app::App,
     cache::maintain,
-    storage::video_database::{extractor_hash::ExtractorHash, getters::get_videos, VideoStatus},
+    storage::video_database::{VideoStatus, extractor_hash::ExtractorHash, getters::get_videos},
     unreachable::Unreachable,
 };
 
@@ -53,12 +53,9 @@ pub async fn watch(app: &App) -> Result<()> {
     let config_path = &app.config.paths.mpv_config_path;
     if config_path.try_exists()? {
         info!("Found mpv.conf at '{}'!", config_path.display());
-        mpv.command(
-            "load-config-file",
-            &[config_path
-                .to_str()
-                .context("Failed to parse the config path is utf8-stringt")?],
-        )?;
+        mpv.command("load-config-file", &[config_path
+            .to_str()
+            .context("Failed to parse the config path is utf8-stringt")?])?;
     } else {
         warn!(
             "Did not find a mpv.conf file at '{}'",
@@ -69,12 +66,9 @@ pub async fn watch(app: &App) -> Result<()> {
     let input_path = &app.config.paths.mpv_input_path;
     if input_path.try_exists()? {
         info!("Found mpv.input.conf at '{}'!", input_path.display());
-        mpv.command(
-            "load-input-conf",
-            &[input_path
-                .to_str()
-                .context("Failed to parse the input path as utf8 string")?],
-        )?;
+        mpv.command("load-input-conf", &[input_path
+            .to_str()
+            .context("Failed to parse the input path as utf8 string")?])?;
     } else {
         warn!(
             "Did not find a mpv.input.conf file at '{}'",
@@ -126,8 +120,11 @@ pub async fn watch(app: &App) -> Result<()> {
                             have_warned.1 = marked_watched;
                         }
                     } else {
-                        warn!("There is nothing to watch yet, but still {} videos marked as to be watched. \
-                        Will idle, until they become available", marked_watched);
+                        warn!(
+                            "There is nothing to watch yet, but still {} videos marked as to be watched. \
+                        Will idle, until they become available",
+                            marked_watched
+                        );
                         have_warned = (true, marked_watched);
                     }
                     time::sleep(Duration::from_secs(10)).await;