Skip to content

Commit 0933687

Browse files
committed
Add transcoding port setting
1 parent aff7687 commit 0933687

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

Jellyfin.Plugin.Enigma2/Configuration/PluginConfiguration.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ public class PluginConfiguration : BasePluginConfiguration
2525

2626
public bool TranscodedStream { get; set; }
2727

28+
public string TranscodingPort { get; set; }
29+
2830
public bool EnableDebugLogging { get; set; }
2931

3032

@@ -47,6 +49,7 @@ public PluginConfiguration()
4749
RecordingPath = "";
4850

4951
TranscodedStream = false;
52+
TranscodingPort = "8002";
5053

5154
EnableDebugLogging = false;
5255
}

Jellyfin.Plugin.Enigma2/Configuration/configPage.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,12 @@ <h1>Enigma2</h1>
136136
Request Transcoded Stream (h264, 720p, 1Mpbs and mp4 as default)
137137
</div>
138138
</div>
139+
<div class="inputContainer">
140+
<input is="emby-input" id="txtTranscodingPort" type="text" label="Enigma2 transcoding port:" />
141+
<div class="fieldDescription">
142+
The Transcoding port of your receiver eg. 8002
143+
</div>
144+
</div>
139145

140146
<label class="checkboxContainer">
141147
<input is="emby-checkbox" type="checkbox" id="chkDebugLogging" />
@@ -174,6 +180,7 @@ <h1>Enigma2</h1>
174180
document.getElementById('txtPiconsPath').value = config.PiconsPath || "";
175181
document.getElementById('txtRecordingPath').value = config.RecordingPath || "";
176182
document.getElementById('chkTranscodedStream').checked = config.TranscodedStream || false;
183+
document.getElementById('txtTranscodingPort').value = config.TranscodingPort || "";
177184
document.getElementById('chkDebugLogging').checked = config.EnableDebugLogging || false;
178185

179186
Dashboard.hideLoadingMsg();
@@ -199,6 +206,7 @@ <h1>Enigma2</h1>
199206
config.PiconsPath = document.getElementById('txtPiconsPath').value;
200207
config.RecordingPath = document.getElementById('txtRecordingPath').value;
201208
config.TranscodedStream = document.getElementById('chkTranscodedStream').checked;
209+
config.TranscodingPort = document.getElementById('txtTranscodingPort').value;
202210
config.EnableDebugLogging = document.getElementById('chkDebugLogging').checked;
203211

204212
ApiClient.updatePluginConfiguration(Enigma2ConfigurationPage.pluginUniqueId, config).then(Dashboard.processPluginConfigurationUpdateResult);

Jellyfin.Plugin.Enigma2/LiveTvService.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ private async Task EnsureConnectionAsync(CancellationToken cancellationToken)
101101
throw new InvalidOperationException("Enigma2 Streaming Port must be configured.");
102102
}
103103

104+
if (config.TranscodedStream && string.IsNullOrEmpty(config.TranscodingPort))
105+
{
106+
_logger.LogError("[Enigma2] Transcoding Port must be configured.");
107+
throw new InvalidOperationException("Enigma2 Transcoding Port must be configured.");
108+
}
109+
104110
if (string.IsNullOrEmpty(config.WebInterfacePort))
105111
{
106112
_logger.LogError("[Enigma2] Web Interface Port must be configured.");
@@ -1128,8 +1134,15 @@ public async Task<MediaSourceInfo> GetChannelStream(string channelOid, string me
11281134
protocol = "https";
11291135
}
11301136

1131-
var baseUrl = protocol + "://" + Plugin.Instance.Configuration.HostName + ":" + Plugin.Instance.Configuration.StreamingPort;
1137+
var streamingPort = Plugin.Instance.Configuration.StreamingPort;
1138+
1139+
if (Plugin.Instance.Configuration.TranscodedStream)
1140+
{
1141+
streamingPort = Plugin.Instance.Configuration.TranscodingPort;
1142+
}
11321143

1144+
var baseUrl = protocol + "://" + Plugin.Instance.Configuration.HostName + ":" + streamingPort;
1145+
11331146
//check if we need to zap to channel - single tuner
11341147
if (Plugin.Instance.Configuration.ZapToChannel)
11351148
{
@@ -1138,7 +1151,7 @@ public async Task<MediaSourceInfo> GetChannelStream(string channelOid, string me
11381151

11391152
if (Plugin.Instance.Configuration.UseLoginForStreams && !string.IsNullOrEmpty(Plugin.Instance.Configuration.WebInterfaceUsername))
11401153
{
1141-
baseUrl = protocol + "://" + Plugin.Instance.Configuration.WebInterfaceUsername + ":" + Plugin.Instance.Configuration.WebInterfacePassword + "@" + Plugin.Instance.Configuration.HostName + ":" + Plugin.Instance.Configuration.StreamingPort;
1154+
baseUrl = protocol + "://" + Plugin.Instance.Configuration.WebInterfaceUsername + ":" + Plugin.Instance.Configuration.WebInterfacePassword + "@" + Plugin.Instance.Configuration.HostName + ":" + streamingPort;
11421155
}
11431156

11441157
var trancodingUrl = "";

0 commit comments

Comments
 (0)