Add transcoding port setting

This commit is contained in:
Tiago Pinto
2022-08-17 10:59:48 +01:00
parent aff7687078
commit 09336872ed
3 changed files with 26 additions and 2 deletions
@@ -25,6 +25,8 @@ namespace Jellyfin.Plugin.Enigma2.Configuration
public bool TranscodedStream { get; set; } public bool TranscodedStream { get; set; }
public string TranscodingPort { get; set; }
public bool EnableDebugLogging { get; set; } public bool EnableDebugLogging { get; set; }
@@ -47,6 +49,7 @@ namespace Jellyfin.Plugin.Enigma2.Configuration
RecordingPath = ""; RecordingPath = "";
TranscodedStream = false; TranscodedStream = false;
TranscodingPort = "8002";
EnableDebugLogging = false; EnableDebugLogging = false;
} }
@@ -136,6 +136,12 @@
Request Transcoded Stream (h264, 720p, 1Mpbs and mp4 as default) Request Transcoded Stream (h264, 720p, 1Mpbs and mp4 as default)
</div> </div>
</div> </div>
<div class="inputContainer">
<input is="emby-input" id="txtTranscodingPort" type="text" label="Enigma2 transcoding port:" />
<div class="fieldDescription">
The Transcoding port of your receiver eg. 8002
</div>
</div>
<label class="checkboxContainer"> <label class="checkboxContainer">
<input is="emby-checkbox" type="checkbox" id="chkDebugLogging" /> <input is="emby-checkbox" type="checkbox" id="chkDebugLogging" />
@@ -174,6 +180,7 @@
document.getElementById('txtPiconsPath').value = config.PiconsPath || ""; document.getElementById('txtPiconsPath').value = config.PiconsPath || "";
document.getElementById('txtRecordingPath').value = config.RecordingPath || ""; document.getElementById('txtRecordingPath').value = config.RecordingPath || "";
document.getElementById('chkTranscodedStream').checked = config.TranscodedStream || false; document.getElementById('chkTranscodedStream').checked = config.TranscodedStream || false;
document.getElementById('txtTranscodingPort').value = config.TranscodingPort || "";
document.getElementById('chkDebugLogging').checked = config.EnableDebugLogging || false; document.getElementById('chkDebugLogging').checked = config.EnableDebugLogging || false;
Dashboard.hideLoadingMsg(); Dashboard.hideLoadingMsg();
@@ -199,6 +206,7 @@
config.PiconsPath = document.getElementById('txtPiconsPath').value; config.PiconsPath = document.getElementById('txtPiconsPath').value;
config.RecordingPath = document.getElementById('txtRecordingPath').value; config.RecordingPath = document.getElementById('txtRecordingPath').value;
config.TranscodedStream = document.getElementById('chkTranscodedStream').checked; config.TranscodedStream = document.getElementById('chkTranscodedStream').checked;
config.TranscodingPort = document.getElementById('txtTranscodingPort').value;
config.EnableDebugLogging = document.getElementById('chkDebugLogging').checked; config.EnableDebugLogging = document.getElementById('chkDebugLogging').checked;
ApiClient.updatePluginConfiguration(Enigma2ConfigurationPage.pluginUniqueId, config).then(Dashboard.processPluginConfigurationUpdateResult); ApiClient.updatePluginConfiguration(Enigma2ConfigurationPage.pluginUniqueId, config).then(Dashboard.processPluginConfigurationUpdateResult);
+15 -2
View File
@@ -101,6 +101,12 @@ namespace Jellyfin.Plugin.Enigma2
throw new InvalidOperationException("Enigma2 Streaming Port must be configured."); throw new InvalidOperationException("Enigma2 Streaming Port must be configured.");
} }
if (config.TranscodedStream && string.IsNullOrEmpty(config.TranscodingPort))
{
_logger.LogError("[Enigma2] Transcoding Port must be configured.");
throw new InvalidOperationException("Enigma2 Transcoding Port must be configured.");
}
if (string.IsNullOrEmpty(config.WebInterfacePort)) if (string.IsNullOrEmpty(config.WebInterfacePort))
{ {
_logger.LogError("[Enigma2] Web Interface Port must be configured."); _logger.LogError("[Enigma2] Web Interface Port must be configured.");
@@ -1128,8 +1134,15 @@ namespace Jellyfin.Plugin.Enigma2
protocol = "https"; protocol = "https";
} }
var baseUrl = protocol + "://" + Plugin.Instance.Configuration.HostName + ":" + Plugin.Instance.Configuration.StreamingPort; var streamingPort = Plugin.Instance.Configuration.StreamingPort;
if (Plugin.Instance.Configuration.TranscodedStream)
{
streamingPort = Plugin.Instance.Configuration.TranscodingPort;
}
var baseUrl = protocol + "://" + Plugin.Instance.Configuration.HostName + ":" + streamingPort;
//check if we need to zap to channel - single tuner //check if we need to zap to channel - single tuner
if (Plugin.Instance.Configuration.ZapToChannel) if (Plugin.Instance.Configuration.ZapToChannel)
{ {
@@ -1138,7 +1151,7 @@ namespace Jellyfin.Plugin.Enigma2
if (Plugin.Instance.Configuration.UseLoginForStreams && !string.IsNullOrEmpty(Plugin.Instance.Configuration.WebInterfaceUsername)) if (Plugin.Instance.Configuration.UseLoginForStreams && !string.IsNullOrEmpty(Plugin.Instance.Configuration.WebInterfaceUsername))
{ {
baseUrl = protocol + "://" + Plugin.Instance.Configuration.WebInterfaceUsername + ":" + Plugin.Instance.Configuration.WebInterfacePassword + "@" + Plugin.Instance.Configuration.HostName + ":" + Plugin.Instance.Configuration.StreamingPort; baseUrl = protocol + "://" + Plugin.Instance.Configuration.WebInterfaceUsername + ":" + Plugin.Instance.Configuration.WebInterfacePassword + "@" + Plugin.Instance.Configuration.HostName + ":" + streamingPort;
} }
var trancodingUrl = ""; var trancodingUrl = "";