about summary refs log tree commit diff stats
path: root/crates/yt/src/download/progress_hook.rs
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-07-10 16:58:59 +0200
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-07-10 16:58:59 +0200
commitc3abafd4878df886dc8765a048cb0b70f282f1f3 (patch)
tree24d5bb2a35d99f7206ba619609e652dffc1c5d17 /crates/yt/src/download/progress_hook.rs
parentdocs(crates/libmpv2): Correctly format doc-test (diff)
downloadyt-c3abafd4878df886dc8765a048cb0b70f282f1f3.zip
refactor(crates/yt): Make every `pub` item `pub(crate)`
Otherwise, rust will not warn use about unused code (and `yt` is not a
library).
Diffstat (limited to '')
-rw-r--r--crates/yt/src/download/progress_hook.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/crates/yt/src/download/progress_hook.rs b/crates/yt/src/download/progress_hook.rs
index ad754b0..99d1a74 100644
--- a/crates/yt/src/download/progress_hook.rs
+++ b/crates/yt/src/download/progress_hook.rs
@@ -13,19 +13,20 @@ use std::{
     process,
 };
 
-use bytes::Bytes;
 use log::{Level, log_enabled};
-use yt_dlp::mk_python_function;
+use owo_colors::OwoColorize;
+use yt_dlp::{json_cast, json_get, wrap_progress_hook};
 
 use crate::{
     ansi_escape_codes::{clear_whole_line, move_to_col},
     select::selection_file::duration::MaybeDuration,
+    shared::bytes::Bytes,
 };
 
 /// # Panics
 /// If expectations fail.
-#[allow(clippy::too_many_lines, clippy::needless_pass_by_value)]
-pub fn progress_hook(
+#[allow(clippy::needless_pass_by_value)]
+pub(crate) fn progress_hook(
     input: serde_json::Map<String, serde_json::Value>,
 ) -> Result<(), std::io::Error> {
     // Only add the handler, if the log-level is higher than Debug (this avoids covering debug
@@ -195,4 +196,4 @@ pub fn progress_hook(
     Ok(())
 }
 
-mk_python_function!(progress_hook, wrapped_progress_hook);
+wrap_progress_hook!(progress_hook, wrapped_progress_hook);