jellyfin-monitor: only trigger for video

This commit is contained in:
Simon Gardling 2025-09-12 11:34:58 -04:00
parent 0e90fff70d
commit 9d8b8ad33f
Signed by: titaniumtown
GPG Key ID: 9AB28AC10ECE533D

View File

@ -54,7 +54,7 @@ class JellyfinQBittorrentMonitor:
response.raise_for_status() response.raise_for_status()
sessions = response.json() sessions = response.json()
# Count active streaming sessions # Count active streaming sessions (video only)
active_streams = [] active_streams = []
for session in sessions: for session in sessions:
if ( if (
@ -62,8 +62,11 @@ class JellyfinQBittorrentMonitor:
and session.get("PlayState", {}).get("IsPaused", True) == False and session.get("PlayState", {}).get("IsPaused", True) == False
): ):
item = session["NowPlayingItem"] item = session["NowPlayingItem"]
user = session.get("UserName", "Unknown") # Only count video streams (Movies, Episodes, etc.)
active_streams.append(f"{user}: {item.get('Name', 'Unknown')}") item_type = item.get("Type", "").lower()
if item_type in ["movie", "episode", "video"]:
user = session.get("UserName", "Unknown")
active_streams.append(f"{user}: {item.get('Name', 'Unknown')}")
return active_streams return active_streams