ui: show resolution and codec counts in streams header
Adds height/codec fields to both Emby/Jellyfin and Plex session data, then surfaces them as chip groups (· 2 4K 3 1080p · 4 H.264 2 HEVC) in the streams card header alongside the existing device type bar. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
bea7b6b045
commit
89df1a98db
@@ -109,6 +109,12 @@ function vv_fetch_jf_sessions(array $srv): array {
|
||||
$method = $pm === 'DirectStream' ? 'Direct Stream' : 'Direct Play';
|
||||
}
|
||||
|
||||
// Source video stream — resolution and codec of the file being played
|
||||
$videoStream = null;
|
||||
foreach ($item['MediaStreams'] ?? [] as $ms) {
|
||||
if (($ms['Type'] ?? '') === 'Video') { $videoStream = $ms; break; }
|
||||
}
|
||||
|
||||
$result[] = [
|
||||
'server' => $srv['name'],
|
||||
'server_type' => $srv['type'],
|
||||
@@ -122,6 +128,8 @@ function vv_fetch_jf_sessions(array $srv): array {
|
||||
'pos_sec' => (int)($pos / 10000000),
|
||||
'dur_sec' => (int)($dur / 10000000),
|
||||
'is_tc' => $tc !== null,
|
||||
'height' => (int)($videoStream['Height'] ?? 0),
|
||||
'codec' => strtolower($videoStream['Codec'] ?? ''),
|
||||
];
|
||||
}
|
||||
return $result;
|
||||
@@ -160,6 +168,12 @@ function vv_fetch_plex_sessions(array $srv): array {
|
||||
}
|
||||
|
||||
$player = $m['Player'] ?? [];
|
||||
$media0 = $m['Media'][0] ?? [];
|
||||
$plexH = (int)($media0['height'] ?? 0);
|
||||
if (!$plexH && !empty($media0['videoResolution'])) {
|
||||
$vr = strtolower($media0['videoResolution']);
|
||||
$plexH = $vr === '4k' ? 2160 : (int)$vr;
|
||||
}
|
||||
$result[] = [
|
||||
'server' => $srv['name'],
|
||||
'server_type' => $srv['type'],
|
||||
@@ -173,6 +187,8 @@ function vv_fetch_plex_sessions(array $srv): array {
|
||||
'pos_sec' => (int)($offset / 1000),
|
||||
'dur_sec' => (int)($dur / 1000),
|
||||
'is_tc' => $isTc,
|
||||
'height' => $plexH,
|
||||
'codec' => strtolower($media0['videoCodec'] ?? ''),
|
||||
];
|
||||
}
|
||||
return $result;
|
||||
|
||||
Reference in New Issue
Block a user