Support Remux and DirectStream transcode types, fixes #1
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Amazed 2023-10-27 17:48:32 +02:00
parent 50941bb95d
commit 7651fa08fe

View File

@ -40,7 +40,16 @@ class SessionsCollector(Collector):
name = session["NowPlayingItem"]["SeriesName"]
else:
name = session["NowPlayingItem"]["Name"]
label_values = [session["Client"], name, session["PlayState"]["PlayMethod"], session["UserName"]]
playmethod = session["PlayState"]["PlayMethod"]
if playmethod == "Transcode":
if "TranscodingInfo" in session:
if session["TranscodingInfo"]["IsVideoDirect"] and session["TranscodingInfo"]["IsAudioDirect"]:
playmethod = "Remux"
elif session["TranscodingInfo"]["IsVideoDirect"] and not session["TranscodingInfo"]["IsAudioDirect"]:
playmethod = "DirectStream"
label_values = [session["Client"], name, playmethod, session["UserName"]]
sessions_metrics.add_metric(label_values, 1)
yield sessions_metrics