From a42a1af8671b9f75107266d60b23538e0f6e73b8 Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Tue, 21 Jun 2016 00:01:41 -0700 Subject: [PATCH] Update stream info on current activity refresh --- .../default/current_activity_instance.html | 96 ++++++------------- data/interfaces/default/index.html | 26 ++++- 2 files changed, 53 insertions(+), 69 deletions(-) diff --git a/data/interfaces/default/current_activity_instance.html b/data/interfaces/default/current_activity_instance.html index 30a7570e..ae4d0b8c 100644 --- a/data/interfaces/default/current_activity_instance.html +++ b/data/interfaces/default/current_activity_instance.html @@ -135,79 +135,39 @@ DOCUMENTATION :: END % endif - % if data['media_type'] == 'track': - % if data['audio_decision'] == 'direct play': - Stream  Direct Play - % elif data['audio_decision'] == 'copy': - Stream  Direct Stream - % else: - Stream   - Transcoding - - (Speed: ${data['transcode_speed']}) + + % if data['video_decision'] == 'transcode' or data['audio_decision'] == 'transcode': + Stream  Transcode (Speed: ${data['transcode_speed']}) % if data['throttled'] == '1': (Throttled) % endif - - - % endif -
- % if data['audio_decision'] == 'direct play': - Audio  Direct Play (${data['audio_codec']}) (${data['audio_channels']}ch) - % elif data['audio_decision'] == 'copy': - Audio  Direct Stream (${data['transcode_audio_codec']}) (${data['transcode_audio_channels']}ch) - % elif data['audio_decision'] == 'transcode': - Audio  Transcode (${data['transcode_audio_codec']}) (${data['transcode_audio_channels']}ch) - % endif - % elif data['media_type'] == 'episode' or data['media_type'] == 'movie' or data['media_type'] == 'clip': - % if data['video_decision'] == 'direct play' and data['audio_decision'] == 'direct play': - Stream  Direct Play - % elif data['video_decision'] == 'copy' and data['audio_decision'] == 'copy': - Stream  Direct Stream - % else: - Stream   - Transcoding - - (Speed: ${data['transcode_speed']}) - % if data['throttled'] == '1': - (Throttled) + + % elif data['video_decision'] == 'copy' or data['audio_decision'] == 'copy': + Stream  Direct Stream + % else: + Stream  Direct Play + % endif +
+ % if data['video_decision'] and data['media_type'] != 'photo': + % if data['video_decision'] == 'transcode': + Video  Transcode (${data['transcode_video_codec']}) (${data['transcode_width']}x${data['transcode_height']}) + % elif data['video_decision'] == 'copy': + Video  Direct Stream (${data['transcode_video_codec']}) (${data['width']}x${data['height']}) + % else: + Video  Direct Play (${data['video_codec']}) (${data['width']}x${data['height']}) % endif -
-
- % endif -
- % if data['video_decision'] == 'direct play': - Video  Direct Play (${data['video_codec']}) (${data['width']}x${data['height']}) - % elif data['video_decision'] == 'copy': - Video  Direct Stream (${data['transcode_video_codec']}) (${data['width']}x${data['height']}) - % elif data['video_decision'] == 'transcode': - Video  Transcode (${data['transcode_video_codec']}) (${data['transcode_width']}x${data['transcode_height']}) - % endif -
- % if data['audio_decision'] == 'direct play': - Audio  Direct Play (${data['audio_codec']}) (${data['audio_channels']}ch) - % elif data['audio_decision'] == 'copy': - Audio  Direct Stream (${data['transcode_audio_codec']}) (${data['transcode_audio_channels']}ch) - % elif data['audio_decision'] == 'transcode': - Audio  Transcode (${data['transcode_audio_codec']}) (${data['transcode_audio_channels']}ch) - % endif - % elif data['media_type'] == 'photo': - % if data['video_decision'] == 'direct play': - Stream  Direct Play - % elif data['video_decision'] == 'copy': - Stream  Direct Stream - % else: - Stream   - - (Speed: ${data['transcode_speed']}) - % if data['throttled'] == '1': - (Throttled) +
+ % endif + % if data['audio_decision']: + % if data['audio_decision'] == 'transcode': + Audio  Transcode (${data['transcode_audio_codec']}) (${data['transcode_audio_channels']}ch) + % elif data['audio_decision'] == 'copy': + Audio  Direct Stream (${data['transcode_audio_codec']}) (${data['transcode_audio_channels']}ch) + % else: + Audio  Direct Play (${data['audio_codec']}) (${data['audio_channels']}ch) % endif -
-
- % endif - % endif -
+ % endif + % if data['media_type'] != 'photo': diff --git a/data/interfaces/default/index.html b/data/interfaces/default/index.html index 501d9a57..d7a597b8 100644 --- a/data/interfaces/default/index.html +++ b/data/interfaces/default/index.html @@ -169,10 +169,34 @@ } // if transcoding, update the transcode state + var ts = ''; if (s.video_decision == 'transcode' || s.audio_decision == 'transcode') { var throttled = (s.throttled == '1') ? ' (Throttled)' : ''; - $('#transcode-state-' + key).html('(Speed: ' + s.transcode_speed + ')' + throttled); + ts += 'Stream  Transcode (Speed: ' + s.transcode_speed + ')' + throttled + '
'; + } else if (s.video_decision == 'copy' || s.audio_decision == 'copy') { + ts += 'Stream  Direct Stream
'; + } else { + ts += 'Stream  Direct Play
'; } + if (s.video_decision != '' && s.media_type != 'photo') { + if (s.video_decision == 'transcode') { + ts += 'Video  Transcode (' + s.transcode_video_codec + ') (' + s.transcode_width + 'x' + s.transcode_height + ')
'; + } else if (s.video_decision == 'copy') { + ts += 'Video  Direct Stream (' + s.transcode_video_codec + ') (' + s.width + 'x' + s.height + ')
'; + } else { + ts += 'Video  Direct Play (' + s.video_codec + ') (' + s.width + 'x' + s.height + ')
'; + } + } + if (s.audio_decision != '') { + if (s.audio_decision == 'transcode') { + ts += 'Audio  Transcode (' + s.transcode_audio_codec + ') (' + s.transcode_audio_channels + 'ch)'; + } else if (s.audio_decision == 'copy') { + ts += 'Audio  Direct Stream (' + s.transcode_audio_codec + ') (' + s.transcode_audio_channels + 'ch)'; + } else { + ts += 'Audio  Direct Play (' + s.audio_codec + ') (' + s.audio_channels + 'ch)'; + } + } + $('#transcode-state-' + key).html(ts); // update the stream progress times $('#stream-eta-' + key).html(moment().add(parseInt(s.duration) - parseInt(s.view_offset), 'milliseconds').format(time_format));