mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 15:56:07 -07:00
Fix some stream info overrides
This commit is contained in:
parent
ca093875b4
commit
f3070763fa
4 changed files with 53 additions and 12 deletions
|
@ -152,15 +152,15 @@ DOCUMENTATION :: END
|
|||
<br />
|
||||
% if data['media_type'] in ('movie', 'episode', 'clip'):
|
||||
% if data['video_decision'] == 'transcode':
|
||||
Video <strong>Transcode (${data['video_codec'].upper()} ${data['video_resolution'].rstrip('p') + ('p' if data['video_resolution'].lower() != 'sd' else '')} → ${data['stream_video_codec'].upper()} ${data['stream_video_resolution'].rstrip('p') + ('p' if data['stream_video_resolution'].lower() != 'sd' else '')})</strong>
|
||||
Video <strong>Transcode (${data['video_codec'].upper()} ${plexpy.common.VIDEO_RESOLUTION_OVERRIDES.get(data['video_resolution'], data['video_resolution'])} → ${data['stream_video_codec'].upper()} ${plexpy.common.VIDEO_RESOLUTION_OVERRIDES.get(data['stream_video_resolution'], data['stream_video_resolution'])})</strong>
|
||||
% elif data['video_decision'] == 'copy':
|
||||
Video <strong>Direct Stream (${data['stream_video_codec'].upper()} ${data['stream_video_resolution'].rstrip('p') + ('p' if data['stream_video_resolution'].lower() != 'sd' else '')})</strong>
|
||||
Video <strong>Direct Stream (${data['stream_video_codec'].upper()} ${plexpy.common.VIDEO_RESOLUTION_OVERRIDES.get(data['stream_video_resolution'], data['stream_video_resolution'])})</strong>
|
||||
% else:
|
||||
Video <strong>Direct Play (${data['video_codec'].upper()} ${data['video_resolution'].rstrip('p') + ('p' if data['video_resolution'].lower() != 'sd' else '')})</strong>
|
||||
Video <strong>Direct Play (${data['video_codec'].upper()} ${plexpy.common.VIDEO_RESOLUTION_OVERRIDES.get(data['video_resolution'], data['video_resolution'])})</strong>
|
||||
% endif
|
||||
<br />
|
||||
% endif
|
||||
% if data['media_type'] in ('movie', 'episode', 'clip', 'track'):
|
||||
% if data['media_type'] in ('movie', 'episode', 'clip', 'track') and data['audio_codec']:
|
||||
% if data['audio_decision'] == 'transcode':
|
||||
Audio <strong>Transcode (${plexpy.common.AUDIO_CODEC_OVERRIDES.get(data['audio_codec'], data['audio_codec'].upper())} ${data['audio_channel_layout']} → ${plexpy.common.AUDIO_CODEC_OVERRIDES.get(data['stream_audio_codec'], data['stream_audio_codec'].upper())} ${data['stream_audio_channel_layout']})</strong>
|
||||
% elif data['audio_decision'] == 'copy':
|
||||
|
@ -169,6 +169,9 @@ DOCUMENTATION :: END
|
|||
Audio <strong>Direct Play (${plexpy.common.AUDIO_CODEC_OVERRIDES.get(data['audio_codec'], data['audio_codec'].upper())} ${data['audio_channel_layout']})</strong>
|
||||
% endif
|
||||
<br />
|
||||
% else:
|
||||
Audio <strong>None</strong>
|
||||
<br />
|
||||
% endif
|
||||
% if data['media_type'] in ('movie', 'episode', 'clip') and data['subtitles'] == '1':
|
||||
% if data['subtitle_decision'] == 'transcode':
|
||||
|
|
|
@ -205,8 +205,26 @@
|
|||
ts += 'Stream <strong>Direct Play</strong><br>';
|
||||
}
|
||||
if (s.video_decision != '' && s.media_type != 'photo') {
|
||||
var v_res = s.video_resolution.replace(/p$/, '') + ((s.video_resolution.toLowerCase() == 'sd') ? '' : 'p');
|
||||
var sv_res = s.stream_video_resolution.replace(/p$/, '') + ((s.stream_video_resolution.toLowerCase() == 'sd') ? '' : 'p');
|
||||
switch (s.video_resolution.toLowerCase()) {
|
||||
case 'sd':
|
||||
var v_res = 'SD';
|
||||
break;
|
||||
case '4k':
|
||||
var v_res = '4k';
|
||||
break;
|
||||
default:
|
||||
var v_res = s.video_resolution + 'p'
|
||||
}
|
||||
switch (s.stream_video_resolution.toLowerCase()) {
|
||||
case 'sd':
|
||||
var sv_res = 'SD';
|
||||
break;
|
||||
case '4k':
|
||||
var sv_res = '4k';
|
||||
break;
|
||||
default:
|
||||
var sv_res = s.stream_video_resolution + 'p'
|
||||
}
|
||||
if (s.video_decision == 'transcode') {
|
||||
ts += 'Video <strong>Transcode (' + s.video_codec.toUpperCase() + ' ' + v_res + ' → ' + s.stream_video_codec.toUpperCase() + ' ' + sv_res + ')</strong><br>';
|
||||
} else if (s.video_decision == 'copy') {
|
||||
|
@ -215,15 +233,20 @@
|
|||
ts += 'Video <strong>Direct Play (' + s.video_codec.toUpperCase() + ' ' + v_res + ')</strong><br>';
|
||||
}
|
||||
}
|
||||
if (s.audio_decision != '') {
|
||||
if (s.audio_codec) {
|
||||
var a_codec = (s.audio_codec == 'truehd') ? 'TrueHD' : s.audio_codec.toUpperCase();
|
||||
var sa_codec = (s.stream_audio_codec == 'truehd') ? 'TrueHD' : s.stream_audio_codec.toUpperCase();
|
||||
if (s.audio_decision == 'transcode') {
|
||||
ts += 'Audio <strong>Transcode (' + s.audio_codec.toUpperCase() + ' ' + s.audio_channel_layout + ' → ' + s.stream_audio_codec.toUpperCase() + ' ' + s.stream_audio_channel_layout + ')</strong><br>';
|
||||
ts += 'Audio <strong>Transcode (' + a_codec + ' ' + s.audio_channel_layout + ' → ' + sa_codec + ' ' + s.stream_audio_channel_layout + ')</strong><br>';
|
||||
} else if (s.audio_decision == 'copy') {
|
||||
ts += 'Audio <strong>Direct Stream (' + s.stream_audio_codec.toUpperCase() + ' ' + s.stream_audio_channel_layout + ')</strong><br>';
|
||||
ts += 'Audio <strong>Direct Stream (' + sa_codec + ' ' + s.stream_audio_channel_layout + ')</strong><br>';
|
||||
} else {
|
||||
ts += 'Audio <strong>Direct Play (' + s.audio_codec.toUpperCase() + ' ' + s.audio_channel_layout + ')</strong><br>';
|
||||
ts += 'Audio <strong>Direct Play (' + a_codec + ' ' + s.audio_channel_layout + ')</strong><br>';
|
||||
}
|
||||
}
|
||||
else {
|
||||
ts += 'Audio <strong>None</strong><br>';
|
||||
}
|
||||
if (s.subtitles) {
|
||||
if (s.subtitle_decision == 'transcode') {
|
||||
ts += 'Subtitle <strong>Transcode (' + s.subtitle_codec.toUpperCase() + ' → ' + s.stream_subtitle_codec.toUpperCase() + ')</strong>';
|
||||
|
|
|
@ -58,6 +58,14 @@ MEDIA_FLAGS_VIDEO = {'avc1': 'h264',
|
|||
|
||||
AUDIO_CODEC_OVERRIDES = {'truehd': 'TrueHD'}
|
||||
|
||||
VIDEO_RESOLUTION_OVERRIDES = {'sd': 'SD',
|
||||
'480': '480p',
|
||||
'576': '576p',
|
||||
'720': '720p',
|
||||
'1080': '1080p',
|
||||
'4k': '4k'
|
||||
}
|
||||
|
||||
AUDIO_CHANNELS = {'1': 'Mono',
|
||||
'2': 'Stereo',
|
||||
'3': '2.1',
|
||||
|
|
|
@ -1279,7 +1279,7 @@ class PmsConnect(object):
|
|||
else:
|
||||
transcode_throttled = 0
|
||||
|
||||
if helpers.get_xml_attr(transcode_info, 'transcodeHwRequested') == '1':
|
||||
if helpers.get_xml_attr(transcode_info, 'transcodeHwFullPipeline') == '1':
|
||||
transcode_hardware = 1
|
||||
else:
|
||||
transcode_hardware = 0
|
||||
|
@ -1404,6 +1404,13 @@ class PmsConnect(object):
|
|||
else:
|
||||
transcode_decision = 'direct play'
|
||||
|
||||
stream_video_width = helpers.get_xml_attr(stream_media_info, 'width')
|
||||
if helpers.cast_to_int(stream_video_width) >= 3840:
|
||||
stream_video_resolution = '4k'
|
||||
else:
|
||||
stream_video_resolution = helpers.get_xml_attr(stream_media_info, 'videoResolution').rstrip('p')
|
||||
|
||||
|
||||
stream_details = {'stream_container': helpers.get_xml_attr(stream_media_info, 'container'),
|
||||
'stream_bitrate': helpers.get_xml_attr(stream_media_info, 'bitrate'),
|
||||
'stream_aspect_ratio': helpers.get_xml_attr(stream_media_info, 'aspectRatio'),
|
||||
|
@ -1412,7 +1419,7 @@ class PmsConnect(object):
|
|||
'stream_audio_channel_layout': common.AUDIO_CHANNELS.get(stream_audio_channels, stream_audio_channels),
|
||||
'stream_video_codec': helpers.get_xml_attr(stream_media_info, 'videoCodec'),
|
||||
'stream_video_framerate': helpers.get_xml_attr(stream_media_info, 'videoFrameRate'),
|
||||
'stream_video_resolution': helpers.get_xml_attr(stream_media_info, 'videoResolution'),
|
||||
'stream_video_resolution': stream_video_resolution,
|
||||
'stream_video_height': helpers.get_xml_attr(stream_media_info, 'height'),
|
||||
'stream_video_width': helpers.get_xml_attr(stream_media_info, 'width'),
|
||||
'stream_duration': helpers.get_xml_attr(stream_media_info, 'duration'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue