aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-11-30 15:13:21 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-11-30 15:13:21 +0100
commit2ab1e54e36f0b9caeb7a0258c75476d3b53b61fd (patch)
tree533651c4798a8a8b756273a1ddb2270a37d0e088
parentfix(yt/commands/select/add): Correct add behaviour (diff)
downloadyt-2ab1e54e36f0b9caeb7a0258c75476d3b53b61fd.zip
fix(yt/commands/status): Show active subscriptions number
-rw-r--r--crates/yt/src/commands/status/implm.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/crates/yt/src/commands/status/implm.rs b/crates/yt/src/commands/status/implm.rs
index dabc5df..5832fde 100644
--- a/crates/yt/src/commands/status/implm.rs
+++ b/crates/yt/src/commands/status/implm.rs
@@ -58,6 +58,11 @@ impl StatusCommand {
let dropped_videos_len = get!(all_videos, Dropped);
let subscriptions = Subscriptions::get(app).await?;
+ let active_subscriptions_len = subscriptions
+ .0
+ .iter()
+ .filter(|(_, sub)| sub.is_active)
+ .count();
let subscriptions_len = subscriptions.0.len();
let watchtime_status = {
@@ -130,6 +135,10 @@ impl StatusCommand {
"{subscriptions_len}",
subscriptions_len.to_string().as_str(),
)
+ .replace(
+ "{active_subscriptions_len}",
+ active_subscriptions_len.to_string().as_str(),
+ )
.replace("{cache_usage}", cache_usage.to_string().as_str());
print!("{output}");
@@ -147,7 +156,7 @@ Dropped Videos: {dropped_videos_len}
{watchtime_status}
- Subscriptions: {subscriptions_len}
+ Subscriptions: {subscriptions_len} ({active_subscriptions_len} active)
Cache usage: {cache_usage}"
);
}