From 3616d0fa152d1447b716ae614d9aabcb2cec5545 Mon Sep 17 00:00:00 2001 From: dkanada Date: Thu, 25 Feb 2021 23:12:20 +0900 Subject: [PATCH] improve session information dialog --- src/controllers/dashboard/dashboard.js | 13 +++++++------ src/strings/en-us.json | 2 ++ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/controllers/dashboard/dashboard.js b/src/controllers/dashboard/dashboard.js index 21c4de798..d77a97341 100644 --- a/src/controllers/dashboard/dashboard.js +++ b/src/controllers/dashboard/dashboard.js @@ -30,9 +30,6 @@ import confirm from '../../components/confirm/confirm'; const text = []; const displayPlayMethod = playMethodHelper.getDisplayPlayMethod(session); - text.push(DashboardPage.getSessionNowPlayingStreamInfo(session)); - text.push('
'); - if (displayPlayMethod === 'Remux') { title = globalize.translate('Remuxing'); text.push(globalize.translate('RemuxHelp1')); @@ -43,9 +40,13 @@ import confirm from '../../components/confirm/confirm'; text.push(globalize.translate('DirectStreamHelp1')); text.push('
'); text.push(globalize.translate('DirectStreamHelp2')); + } else if (displayPlayMethod === 'DirectPlay') { + title = globalize.translate('DirectPlaying'); + text.push(globalize.translate('DirectPlayHelp')); } else if (displayPlayMethod === 'Transcode') { title = globalize.translate('Transcoding'); text.push(globalize.translate('MediaIsBeingConverted')); + text.push(DashboardPage.getSessionNowPlayingStreamInfo(session)); if (session.TranscodingInfo && session.TranscodingInfo.TranscodeReasons && session.TranscodingInfo.TranscodeReasons.length) { text.push('
'); @@ -403,10 +404,8 @@ import confirm from '../../components/confirm/confirm'; } else if (displayPlayMethod === 'DirectStream') { html += globalize.translate('DirectStreaming'); } else if (displayPlayMethod === 'Transcode') { - html += globalize.translate('Transcoding'); - if (session.TranscodingInfo && session.TranscodingInfo.Framerate) { - html += ' (' + session.TranscodingInfo.Framerate + ' fps)'; + html += `${globalize.translate('Framerate')}: ${session.TranscodingInfo.Framerate}fps`; } showTranscodingInfo = true; @@ -550,8 +549,10 @@ import confirm from '../../components/confirm/confirm'; if (nowPlayingItem) { row.classList.add('playingSession'); + row.querySelector('.btnSessionInfo').classList.remove('hide'); } else { row.classList.remove('playingSession'); + row.querySelector('.btnSessionInfo').classList.add('hide'); } if (session.ServerId && session.SupportedCommands.indexOf('DisplayMessage') !== -1) { diff --git a/src/strings/en-us.json b/src/strings/en-us.json index 23457106d..e4250bf95 100644 --- a/src/strings/en-us.json +++ b/src/strings/en-us.json @@ -176,6 +176,7 @@ "Director": "Director", "Directors": "Directors", "DirectPlaying": "Direct playing", + "DirectPlayHelp": "The source file is entirely compatible with this client, and the session is receiving the file without modifications.", "DirectStreamHelp1": "The video stream is compatible with the device, but has an incompatible audio format (DTS, TRUEHD, etc) or number of audio channels. The video stream will be repackaged losslessly on the fly before being sent to the device. Only the audio stream will be transcoded.", "DirectStreamHelp2": "Power consumed by direct streaming usually depends on the audio profile. Only the video stream is lossless.", "DirectStreaming": "Direct streaming", @@ -261,6 +262,7 @@ "Filters": "Filters", "Folders": "Folders", "FormatValue": "Format: {0}", + "Framerate": "Framerate", "Friday": "Friday", "Fullscreen": "Full screen", "General": "General",