5 Commits
Author SHA1 Message Date
knackebrot d38c1595d8 Update for Jellyfin 10.9 2024-06-22 20:16:55 +02:00
knackebrot 309e7c4110 Merge pull request #13 from tiagoqpinto/jellyfin
Add Transcoding option to settings
2022-08-22 21:42:48 +02:00
Tiago Pinto 09336872ed Add transcoding port setting 2022-08-17 10:59:48 +01:00
Tiago Pinto aff7687078 Add Transcoding option to settings 2022-07-19 15:12:45 +01:00
knackebrot a2e9686898 Update for Jellyfin 10.8
- Change branding from Vu+ to Enigma2

- Fix wrong default hostname

- Add new options UseLoginForStreams, UseHTTPSForStreams

- Use new GUID to avoid clashing with the older version of plugin
2022-06-29 02:40:53 +02:00
12 changed files with 389 additions and 250 deletions
+41
View File
@@ -0,0 +1,41 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/Jellyfin.Plugin.Enigma2/Jellyfin.Plugin.Enigma2.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "publish",
"command": "dotnet",
"type": "process",
"args": [
"publish",
"${workspaceFolder}/Jellyfin.Plugin.Enigma2/Jellyfin.Plugin.Enigma2.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile"
},
{
"label": "watch",
"command": "dotnet",
"type": "process",
"args": [
"watch",
"run",
"--project",
"${workspaceFolder}/Jellyfin.Plugin.Enigma2/Jellyfin.Plugin.Enigma2.csproj"
],
"problemMatcher": "$msCompile"
}
]
}
@@ -1,9 +1,9 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.31105.61
# Visual Studio Version 17
VisualStudioVersion = 17.2.32616.157
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MediaBrowser.Plugins.VuPlus", "MediaBrowser.Plugins.VuPlus\MediaBrowser.Plugins.VuPlus.csproj", "{52B1ABDF-09C1-450E-B808-BBA0A9C19848}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Jellyfin.Plugin.Enigma2", "Jellyfin.Plugin.Enigma2\Jellyfin.Plugin.Enigma2.csproj", "{52B1ABDF-09C1-450E-B808-BBA0A9C19848}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A968FB09-8732-407C-8748-6DB383EB5D91}"
ProjectSection(SolutionItems) = preProject
@@ -1,6 +1,6 @@
using MediaBrowser.Model.Plugins;
namespace MediaBrowser.Plugins.VuPlus.Configuration
namespace Jellyfin.Plugin.Enigma2.Configuration
{
/// <summary>
/// Class PluginConfiguration
@@ -12,7 +12,9 @@ namespace MediaBrowser.Plugins.VuPlus.Configuration
public string WebInterfacePort { get; set; }
public string WebInterfaceUsername { get; set; }
public string WebInterfacePassword { get; set; }
public bool UseLoginForStreams { get; set; }
public bool UseSecureHTTPS { get; set; }
public bool UseSecureHTTPSForStreams { get; set; }
public bool OnlyOneBouquet { get; set; }
public string TVBouquet { get; set; }
public bool ZapToChannel { get; set; }
@@ -21,17 +23,23 @@ namespace MediaBrowser.Plugins.VuPlus.Configuration
public string RecordingPath { get; set; }
public bool TranscodedStream { get; set; }
public string TranscodingPort { get; set; }
public bool EnableDebugLogging { get; set; }
public PluginConfiguration()
{
HostName = "http://localhost";
HostName = "localhost";
StreamingPort = "8001";
WebInterfacePort = "8000";
WebInterfaceUsername = "";
WebInterfacePassword = "";
UseLoginForStreams = false;
UseSecureHTTPS = false;
UseSecureHTTPSForStreams = false;
OnlyOneBouquet = true;
TVBouquet = "Favourites (TV)";
ZapToChannel = false;
@@ -40,8 +48,10 @@ namespace MediaBrowser.Plugins.VuPlus.Configuration
RecordingPath = "";
EnableDebugLogging = false;
TranscodedStream = false;
TranscodingPort = "8002";
EnableDebugLogging = false;
}
}
}
@@ -1,46 +1,56 @@
<!DOCTYPE html>
<html>
<head>
<title>Vu+</title>
<title>Enigma2</title>
</head>
<body>
<div data-role="page" id="VuPlusConfigurationPage" class="page type-interior pluginConfigurationPage VuPlusConfigurationPage" data-require="emby-button,emby-checkbox,emby-input">
<div data-role="page" id="Enigma2ConfigurationPage" class="page type-interior pluginConfigurationPage Enigma2ConfigurationPage" data-require="emby-button,emby-checkbox,emby-input">
<div data-role="content">
<div class="content-primary">
<h1>VuPlus</h1>
<h1>Enigma2</h1>
<form id="VuPlusConfigurationForm" class="VuPlusConfigurationForm">
<form id="Enigma2ConfigurationForm" class="Enigma2ConfigurationForm">
<div class="inputContainer">
<input is="emby-input" id="txtHostName" type="text" label="Vu+ hostname or ip address:" />
<input is="emby-input" id="txtHostName" type="text" label="Enigma2 hostname or ip address:" />
<div class="fieldDescription">
The host name (address) or ip address of your receiver
</div>
</div>
<div class="inputContainer">
<input is="emby-input" id="txtStreamingPort" type="text" label="Vu+ streaming port:" />
<input is="emby-input" id="txtStreamingPort" type="text" label="Enigma2 streaming port:" />
<div class="fieldDescription">
The Streaming port of your receiver eg. 8001
</div>
</div>
<div class="inputContainer">
<input is="emby-input" id="txtWebInterfacePort" type="text" label="Vu+ Web Interface port:" />
<input is="emby-input" id="txtWebInterfacePort" type="text" label="Enigma2 Web Interface port:" />
<div class="fieldDescription">
The web Interface port of your receiver eg. 8000
The web interface port of your receiver eg. 8000
</div>
</div>
<div class="inputContainer">
<input is="emby-input" id="txtWebInterfaceUsername" type="text" label="Vu+ Web Interface username:" />
<input is="emby-input" id="txtWebInterfaceUsername" type="text" label="Enigma2 Web Interface username:" />
<div class="fieldDescription">
The web Interface username of your receiver (optional)
The web interface username of your receiver (optional)
</div>
</div>
<div class="inputContainer">
<input is="emby-input" id="txtWebInterfacePassword" type="text" label="Vu+ Web Interface password:" />
<input is="emby-input" id="txtWebInterfacePassword" type="password" label="Enigma2 Web Interface password:" />
<div class="fieldDescription">
The web Interface password of your receiver (optional)
The web interface password of your receiver (optional)
</div>
</div>
<div class="checkboxContainer checkboxContainer-withDescription">
<label>
<input is="emby-checkbox" type="checkbox" id="chkUseLoginForStreams" />
<span>Use login for streaming</span>
</label>
<div class="fieldDescription checkboxFieldDescription">
Use web interface login for streaming
</div>
</div>
@@ -54,6 +64,16 @@
</div>
</div>
<div class="checkboxContainer checkboxContainer-withDescription">
<label>
<input is="emby-checkbox" type="checkbox" id="chkUseSecureHTTPSForStreams" />
<span>Use secure HTTP (HTTPS) for streams</span>
</label>
<div class="fieldDescription checkboxFieldDescription">
Use HTTPS to connect to streaming port
</div>
</div>
<div class="checkboxContainer checkboxContainer-withDescription">
<label>
<input is="emby-checkbox" type="checkbox" id="chkOnlyOneBouquet" />
@@ -66,7 +86,7 @@
<div class="inputContainer">
<input is="emby-input" id="txtTVBouquet" type="text" label="Vu+ TVBouquet:" />
<input is="emby-input" id="txtTVBouquet" type="text" label="Enigma2 TVBouquet:" />
<div class="fieldDescription">
The TV Bouquet to load channels for (optional)
</div>
@@ -107,9 +127,25 @@
</div>
</div>
<div class="checkboxContainer checkboxContainer-withDescription">
<label>
<input is="emby-checkbox" type="checkbox" id="chkTranscodedStream" />
<span>Request Transcoded Stream</span>
</label>
<div class="fieldDescription checkboxFieldDescription">
Request Transcoded Stream (h264, 720p, 1Mpbs and mp4 as default)
</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">
<input is="emby-checkbox" type="checkbox" id="chkDebugLogging" />
<span>Enable VuPlus debug logging</span>
<span>Enable Enigma2 debug logging</span>
</label>
<div>
@@ -122,25 +158,29 @@
<script type="text/javascript">
var VuPlusConfigurationPage = {
pluginUniqueId: "9564ac10-af23-39bc-449f-624f23cfa48f",
var Enigma2ConfigurationPage = {
pluginUniqueId: "193f29f9-ea6c-4595-a6f6-55e79d7c590a",
loadConfiguration: function () {
Dashboard.showLoadingMsg();
ApiClient.getPluginConfiguration(VuPlusConfigurationPage.pluginUniqueId).then(function (config) {
ApiClient.getPluginConfiguration(Enigma2ConfigurationPage.pluginUniqueId).then(function (config) {
document.getElementById('txtHostName').value = config.HostName || "";
document.getElementById('txtStreamingPort').value = config.StreamingPort || "";
document.getElementById('txtWebInterfacePort').value = config.WebInterfacePort || "";
document.getElementById('txtWebInterfaceUsername').value = config.WebInterfaceUsername || "";
document.getElementById('txtWebInterfacePassword').value = config.WebInterfacePassword || "";
document.getElementById('chkUseLoginForStreams').checked = config.UseLoginForStreams || false;
document.getElementById('chkUseSecureHTTPS').checked = config.UseSecureHTTPS || false;
document.getElementById('chkUseSecureHTTPSForStreams').checked = config.UseSecureHTTPSForStreams || false;
document.getElementById('chkOnlyOneBouquet').checked = config.OnlyOneBouquet || false;
document.getElementById('txtTVBouquet').value = config.TVBouquet || "";
document.getElementById('chkZapToChannel').checked = config.ZapToChannel || false;
document.getElementById('chkFetchPiconsFromWebInterface').checked = config.FetchPiconsFromWebInterface || false;
document.getElementById('txtPiconsPath').value = config.PiconsPath || "";
document.getElementById('txtRecordingPath').value = config.RecordingPath || "";
document.getElementById('chkTranscodedStream').checked = config.TranscodedStream || false;
document.getElementById('txtTranscodingPort').value = config.TranscodingPort || "";
document.getElementById('chkDebugLogging').checked = config.EnableDebugLogging || false;
Dashboard.hideLoadingMsg();
@@ -150,33 +190,37 @@
saveConfiguration: function () {
Dashboard.showLoadingMsg();
ApiClient.getPluginConfiguration(VuPlusConfigurationPage.pluginUniqueId).then(function (config) {
ApiClient.getPluginConfiguration(Enigma2ConfigurationPage.pluginUniqueId).then(function (config) {
config.HostName = document.getElementById('txtHostName').value;
config.StreamingPort = document.getElementById('txtStreamingPort').value;
config.WebInterfacePort = document.getElementById('txtWebInterfacePort').value;
config.WebInterfaceUsername = document.getElementById('txtWebInterfaceUsername').value;
config.WebInterfacePassword = document.getElementById('txtWebInterfacePassword').value;
config.UseLoginForStreams = document.getElementById('chkUseLoginForStreams').checked;
config.UseSecureHTTPS = document.getElementById('chkUseSecureHTTPS').checked;
config.UseSecureHTTPSForStreams = document.getElementById('chkUseSecureHTTPSForStreams').checked;
config.OnlyOneBouquet = document.getElementById('chkOnlyOneBouquet').checked;
config.TVBouquet = document.getElementById('txtTVBouquet').value;
config.ZapToChannel = document.getElementById('chkZapToChannel').checked;
config.FetchPiconsFromWebInterface = document.getElementById('chkFetchPiconsFromWebInterface').checked;
config.PiconsPath = document.getElementById('txtPiconsPath').value;
config.RecordingPath = document.getElementById('txtRecordingPath').value;
config.TranscodedStream = document.getElementById('chkTranscodedStream').checked;
config.TranscodingPort = document.getElementById('txtTranscodingPort').value;
config.EnableDebugLogging = document.getElementById('chkDebugLogging').checked;
ApiClient.updatePluginConfiguration(VuPlusConfigurationPage.pluginUniqueId, config).then(Dashboard.processPluginConfigurationUpdateResult);
ApiClient.updatePluginConfiguration(Enigma2ConfigurationPage.pluginUniqueId, config).then(Dashboard.processPluginConfigurationUpdateResult);
});
}
}
document.getElementById('VuPlusConfigurationPage').addEventListener('pageshow', function () {
VuPlusConfigurationPage.loadConfiguration();
document.getElementById('Enigma2ConfigurationPage').addEventListener('pageshow', function () {
Enigma2ConfigurationPage.loadConfiguration();
});
document.getElementById('VuPlusConfigurationForm').addEventListener('submit', function (e) {
document.getElementById('Enigma2ConfigurationForm').addEventListener('submit', function (e) {
e.preventDefault();
VuPlusConfigurationPage.saveConfiguration();
Enigma2ConfigurationPage.saveConfiguration();
});
</script>
</div>
@@ -2,7 +2,7 @@ using System;
using MediaBrowser.Model.LiveTv;
using Microsoft.Extensions.Logging;
namespace MediaBrowser.Plugins.VuPlus.Helpers
namespace Jellyfin.Plugin.Enigma2.Helpers
{
public static class ChannelHelper
{

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

@@ -1,16 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net5.0</TargetFrameworks>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<FileVersion>4.0.0.0</FileVersion>
<TargetFrameworks>net8.0</TargetFrameworks>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<FileVersion>6.0.0.0</FileVersion>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net5.0|AnyCPU'">
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net6.0|AnyCPU'">
<DebugType>none</DebugType>
<DebugSymbols>false</DebugSymbols>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net8.0|AnyCPU'">
<DebugType>none</DebugType>
</PropertyGroup>
<ItemGroup>
<None Remove="Configuration\configPage.html" />
</ItemGroup>
@@ -20,12 +24,12 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Jellyfin.Common" Version="10.7.0" />
<PackageReference Include="Jellyfin.Naming" Version="10.7.0" />
<PackageReference Include="Jellyfin.Controller" Version="10.7.0" />
<PackageReference Include="Jellyfin.Model" Version="10.7.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.1" />
<PackageReference Include="Microsoft.Extensions.Http" Version="5.0.0" />
<PackageReference Include="Jellyfin.Common" Version="10.9.0" />
<PackageReference Include="Jellyfin.Naming" Version="10.9.0" />
<PackageReference Include="Jellyfin.Controller" Version="10.9.0" />
<PackageReference Include="Jellyfin.Model" Version="10.9.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
</ItemGroup>
</Project>
@@ -17,102 +17,111 @@ using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.LiveTv;
using MediaBrowser.Model.MediaInfo;
using MediaBrowser.Plugins.VuPlus.Helpers;
using Jellyfin.Plugin.Enigma2.Helpers;
using Microsoft.Extensions.Logging;
namespace MediaBrowser.Plugins.VuPlus
namespace Jellyfin.Plugin.Enigma2
{
/// <summary>
/// Class LiveTvService
/// </summary>
public class LiveTvService : ILiveTvService
{
private readonly CultureInfo _usCulture = new CultureInfo("en-US");
private readonly ILogger<LiveTvService> _logger;
private int _liveStreams;
private readonly Dictionary<int, int> _heartBeat = new Dictionary<int, int>();
private string tvBouquetSRef;
private List<ChannelInfo> tvChannelInfos = new List<ChannelInfo>();
public DateTime LastRecordingChange = DateTime.MinValue;
private readonly HttpClient _httpClient;
private IHttpClientFactory _httpClientFactory;
public static LiveTvService Instance { get; private set; }
public LiveTvService(ILogger<LiveTvService> logger, IHttpClientFactory httpClientFactory)
{
_logger = logger;
_httpClient = GetHttpClient(httpClientFactory);
_httpClientFactory = httpClientFactory;
Instance = this;
}
/// <summary>
/// Ensure that we are connected to the VuPlus server
/// Ensure that we are connected to the Enigma2 server
/// </summary>
/// <param name="cancellationToken"></param>
/// <returns></returns>
private async Task EnsureConnectionAsync(CancellationToken cancellationToken)
public async Task EnsureConnectionAsync(CancellationToken cancellationToken)
{
_logger.LogInformation("[VuPlus] Start EnsureConnectionAsync");
_logger.LogInformation("[Enigma2] Start EnsureConnectionAsync");
var config = Plugin.Instance.Configuration;
// log settings
_logger.LogInformation(string.Format("[VuPlus] EnsureConnectionAsync HostName: {0}", config.HostName));
_logger.LogInformation(string.Format("[VuPlus] EnsureConnectionAsync StreamingPort: {0}", config.StreamingPort));
_logger.LogInformation(string.Format("[VuPlus] EnsureConnectionAsync WebInterfacePort: {0}", config.WebInterfacePort));
_logger.LogInformation(string.Format("[Enigma2] EnsureConnectionAsync HostName: {0}", config.HostName));
_logger.LogInformation(string.Format("[Enigma2] EnsureConnectionAsync StreamingPort: {0}", config.StreamingPort));
_logger.LogInformation(string.Format("[Enigma2] EnsureConnectionAsync WebInterfacePort: {0}", config.WebInterfacePort));
if (string.IsNullOrEmpty(config.WebInterfaceUsername))
{
_logger.LogInformation("[VuPlus] EnsureConnectionAsync WebInterfaceUsername: ");
_logger.LogInformation("[Enigma2] EnsureConnectionAsync WebInterfaceUsername: ");
}
else
{
_logger.LogInformation(string.Format("[VuPlus] EnsureConnectionAsync WebInterfaceUsername: {0}", "********"));
_logger.LogInformation(string.Format("[Enigma2] EnsureConnectionAsync WebInterfaceUsername: {0}", "********"));
}
if (string.IsNullOrEmpty(config.WebInterfacePassword))
{
_logger.LogInformation("[VuPlus] EnsureConnectionAsync WebInterfacePassword: ");
_logger.LogInformation("[Enigma2] EnsureConnectionAsync WebInterfacePassword: ");
}
else
{
_logger.LogInformation(string.Format("[VuPlus] EnsureConnectionAsync WebInterfaceUsername: {0}", "********"));
_logger.LogInformation(string.Format("[Enigma2] EnsureConnectionAsync WebInterfaceUsername: {0}", "********"));
}
_logger.LogInformation(string.Format("[VuPlus] EnsureConnectionAsync UseSecureHTTPS: {0}", config.UseSecureHTTPS));
_logger.LogInformation(string.Format("[VuPlus] EnsureConnectionAsync OnlyOneBouquet: {0}", config.OnlyOneBouquet));
_logger.LogInformation(string.Format("[VuPlus] EnsureConnectionAsync TVBouquet: {0}", config.TVBouquet));
_logger.LogInformation(string.Format("[VuPlus] EnsureConnectionAsync ZapToChannel: {0}", config.ZapToChannel));
_logger.LogInformation(string.Format("[VuPlus] EnsureConnectionAsync FetchPiconsFromWebInterface: {0}", config.FetchPiconsFromWebInterface));
_logger.LogInformation(string.Format("[VuPlus] EnsureConnectionAsync PiconsPath: {0}", config.PiconsPath));
_logger.LogInformation(string.Format("[VuPlus] EnsureConnectionAsync RecordingPath: {0}", config.RecordingPath));
_logger.LogInformation(string.Format("[VuPlus] EnsureConnectionAsync EnableDebugLogging: {0}", config.EnableDebugLogging));
_logger.LogInformation(string.Format("[Enigma2] EnsureConnectionAsync UseLoginForStreams: {0}", config.UseLoginForStreams));
_logger.LogInformation(string.Format("[Enigma2] EnsureConnectionAsync UseSecureHTTPS: {0}", config.UseSecureHTTPS));
_logger.LogInformation(string.Format("[Enigma2] EnsureConnectionAsync UseSecureHTTPSForStreams: {0}", config.UseSecureHTTPSForStreams));
_logger.LogInformation(string.Format("[Enigma2] EnsureConnectionAsync OnlyOneBouquet: {0}", config.OnlyOneBouquet));
_logger.LogInformation(string.Format("[Enigma2] EnsureConnectionAsync TVBouquet: {0}", config.TVBouquet));
_logger.LogInformation(string.Format("[Enigma2] EnsureConnectionAsync ZapToChannel: {0}", config.ZapToChannel));
_logger.LogInformation(string.Format("[Enigma2] EnsureConnectionAsync FetchPiconsFromWebInterface: {0}", config.FetchPiconsFromWebInterface));
_logger.LogInformation(string.Format("[Enigma2] EnsureConnectionAsync PiconsPath: {0}", config.PiconsPath));
_logger.LogInformation(string.Format("[Enigma2] EnsureConnectionAsync RecordingPath: {0}", config.RecordingPath));
_logger.LogInformation(string.Format("[Enigma2] EnsureConnectionAsync EnableDebugLogging: {0}", config.EnableDebugLogging));
// validate settings
if (string.IsNullOrEmpty(config.HostName))
{
_logger.LogError("[VuPlus] HostName must be configured.");
throw new InvalidOperationException("VuPlus HostName must be configured.");
_logger.LogError("[Enigma2] HostName must be configured.");
throw new InvalidOperationException("Enigma2 HostName must be configured.");
}
if (string.IsNullOrEmpty(config.StreamingPort))
{
_logger.LogError("[VuPlus] Streaming Port must be configured.");
throw new InvalidOperationException("VuPlus Streaming Port must be configured.");
_logger.LogError("[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))
{
_logger.LogError("[VuPlus] Web Interface Port must be configured.");
throw new InvalidOperationException("VuPlus Web Interface Port must be configured.");
_logger.LogError("[Enigma2] Web Interface Port must be configured.");
throw new InvalidOperationException("Enigma2 Web Interface Port must be configured.");
}
if (config.OnlyOneBouquet)
{
if (string.IsNullOrEmpty(config.TVBouquet))
{
_logger.LogError("[VuPlus] TV Bouquet must be configured if Fetch only one TV bouquet selected.");
throw new InvalidOperationException("VuPlus TVBouquet must be configured if Fetch only one TV bouquet selected.");
_logger.LogError("[Enigma2] TV Bouquet must be configured if Fetch only one TV bouquet selected.");
throw new InvalidOperationException("Enigma2 TVBouquet must be configured if Fetch only one TV bouquet selected.");
}
}
@@ -120,21 +129,21 @@ namespace MediaBrowser.Plugins.VuPlus
{
if (string.IsNullOrEmpty(config.PiconsPath))
{
_logger.LogError("[VuPlus] Picons location must be configured if Fetch Picons from Web Service is disabled.");
throw new InvalidOperationException("VuPlus Picons location must be configured if Fetch Picons from Web Service is disabled.");
_logger.LogError("[Enigma2] Picons location must be configured if Fetch Picons from Web Service is disabled.");
throw new InvalidOperationException("Enigma2 Picons location must be configured if Fetch Picons from Web Service is disabled.");
}
}
_logger.LogInformation("[VuPlus] EnsureConnectionAsync Validation of config parameters completed");
_logger.LogInformation("[Enigma2] EnsureConnectionAsync Validation of config parameters completed");
if (config.OnlyOneBouquet)
{
// connect to VuPlus box to test connectivity and at same time get sRef for TV Bouquet.
// connect to Enigma2 box to test connectivity and at same time get sRef for TV Bouquet.
tvBouquetSRef = await InitiateSession(cancellationToken, config.TVBouquet).ConfigureAwait(false);
}
else
{
// connect to VuPlus box to test connectivity.
// connect to Enigma2 box to test connectivity.
var resultNotRequired = await InitiateSession(cancellationToken, null).ConfigureAwait(false);
tvBouquetSRef = null;
}
@@ -145,9 +154,9 @@ namespace MediaBrowser.Plugins.VuPlus
/// </summary>
/// <param name="httpClientFactory"></param>
/// <returns></returns>
private HttpClient GetHttpClient(IHttpClientFactory httpClientFactory)
private HttpClient GetHttpClient()
{
var httpClient = httpClientFactory.CreateClient(NamedClient.Default);
var httpClient = _httpClientFactory.CreateClient(NamedClient.Default);
httpClient.DefaultRequestHeaders.UserAgent.Add(
new ProductInfoHeaderValue(Name, Plugin.Instance.Version.ToString()));
@@ -162,14 +171,14 @@ namespace MediaBrowser.Plugins.VuPlus
}
/// <summary>
/// Checks connection to VuPlus and retrieves service reference for channel if only one bouquet.
/// Checks connection to Enigma2 and retrieves service reference for channel if only one bouquet.
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <param name="tvBouquet">The TV Bouquet.</param>
/// <returns>Task{String>}.</returns>
public async Task<string> InitiateSession(CancellationToken cancellationToken, string tvBouquet)
{
_logger.LogInformation("[VuPlus] Start InitiateSession, validates connection and returns Bouquet reference if required");
_logger.LogInformation("[Enigma2] Start InitiateSession, validates connection and returns Bouquet reference if required");
//await EnsureConnectionAsync(cancellationToken).ConfigureAwait(false);
var protocol = "http";
@@ -181,14 +190,14 @@ namespace MediaBrowser.Plugins.VuPlus
var baseUrl = protocol + "://" + Plugin.Instance.Configuration.HostName + ":" + Plugin.Instance.Configuration.WebInterfacePort;
var url = string.Format("{0}/web/getservices", baseUrl);
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] InitiateSession url: {0}", url));
UtilsHelper.DebugInformation(_logger, string.Format("[Enigma2] InitiateSession url: {0}", url));
using (var stream = await _httpClient.GetStreamAsync(url, cancellationToken).ConfigureAwait(false))
using (var stream = await GetHttpClient().GetStreamAsync(url, cancellationToken).ConfigureAwait(false))
{
using (var reader = new StreamReader(stream))
{
var xmlResponse = reader.ReadToEnd();
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] InitiateSession response: {0}", xmlResponse));
UtilsHelper.DebugInformation(_logger, string.Format("[Enigma2] InitiateSession response: {0}", xmlResponse));
try
{
@@ -229,17 +238,17 @@ namespace MediaBrowser.Plugins.VuPlus
// make sure we have found the TV Bouquet
if (!string.IsNullOrEmpty(tvBouquet))
{
_logger.LogError("[VuPlus] Failed to find TV Bouquet specified in VuPlus configuration.");
throw new ApplicationException("Failed to find TV Bouquet specified in VuPlus configuration.");
_logger.LogError("[Enigma2] Failed to find TV Bouquet specified in Enigma2 configuration.");
throw new ApplicationException("Failed to find TV Bouquet specified in Enigma2 configuration.");
}
}
return tvBouquetReference;
}
catch (Exception e)
{
_logger.LogError("[VuPlus] Failed to parse services information.");
_logger.LogError(string.Format("[VuPlus] InitiateSession error: {0}", e.Message));
throw new ApplicationException("Failed to connect to VuPlus.");
_logger.LogError("[Enigma2] Failed to parse services information.");
_logger.LogError(string.Format("[Enigma2] InitiateSession error: {0}", e.Message));
throw new ApplicationException("Failed to connect to Enigma2.");
}
}
@@ -254,7 +263,7 @@ namespace MediaBrowser.Plugins.VuPlus
/// <returns>Task{IEnumerable{ChannelInfo}}.</returns>
public async Task<IEnumerable<ChannelInfo>> GetChannelsAsync(CancellationToken cancellationToken)
{
_logger.LogInformation("[VuPlus] Start GetChannelsAsync, retrieve all channels");
_logger.LogInformation("[Enigma2] Start GetChannelsAsync, retrieve all channels");
await EnsureConnectionAsync(cancellationToken).ConfigureAwait(false);
var protocol = "http";
@@ -267,7 +276,7 @@ namespace MediaBrowser.Plugins.VuPlus
var baseUrlPicon = protocol + "://" + Plugin.Instance.Configuration.HostName + ":" + Plugin.Instance.Configuration.WebInterfacePort;
var url = "";
string url;
if (string.IsNullOrEmpty(tvBouquetSRef))
{
url = string.Format("{0}/web/getservices", baseUrl);
@@ -277,20 +286,20 @@ namespace MediaBrowser.Plugins.VuPlus
url = string.Format("{0}/web/getservices?sRef={1}", baseUrl, tvBouquetSRef);
}
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] GetChannelsAsync url: {0}", url));
UtilsHelper.DebugInformation(_logger, string.Format("[Enigma2] GetChannelsAsync url: {0}", url));
if (!string.IsNullOrEmpty(Plugin.Instance.Configuration.WebInterfaceUsername))
{
baseUrlPicon = protocol + "://" + Plugin.Instance.Configuration.WebInterfaceUsername + ":" + Plugin.Instance.Configuration.WebInterfacePassword + "@" + Plugin.Instance.Configuration.HostName + ":" + Plugin.Instance.Configuration.WebInterfacePort;
}
using (var stream = await _httpClient.GetStreamAsync(url, cancellationToken).ConfigureAwait(false))
using (var stream = await GetHttpClient().GetStreamAsync(url, cancellationToken).ConfigureAwait(false))
{
using (var reader = new StreamReader(stream))
{
var xmlResponse = reader.ReadToEnd();
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] GetChannelsAsync response: {0}", xmlResponse));
UtilsHelper.DebugInformation(_logger, string.Format("[Enigma2] GetChannelsAsync response: {0}", xmlResponse));
try
{
@@ -302,7 +311,7 @@ namespace MediaBrowser.Plugins.VuPlus
if (string.IsNullOrEmpty(tvBouquetSRef))
{
// Load channels from all TV Bouquets
_logger.LogInformation("[VuPlus] GetChannelsAsync for all TV Bouquets");
_logger.LogInformation("[Enigma2] GetChannelsAsync for all TV Bouquets");
var e2services = xml.GetElementsByTagName("e2service");
foreach (XmlNode xmlNode in e2services)
@@ -400,7 +409,7 @@ namespace MediaBrowser.Plugins.VuPlus
}
else
{
_logger.LogInformation("[VuPlus] ignoring channel label " + e2servicereference);
_logger.LogInformation("[Enigma2] ignoring channel label " + e2servicereference);
}
}
}
@@ -409,8 +418,8 @@ namespace MediaBrowser.Plugins.VuPlus
}
catch (Exception e)
{
_logger.LogError("[VuPlus] Failed to parse channel information.");
_logger.LogError(string.Format("[VuPlus] GetChannelsAsync error: {0}", e.Message));
_logger.LogError("[Enigma2] Failed to parse channel information.");
_logger.LogError(string.Format("[Enigma2] GetChannelsAsync error: {0}", e.Message));
throw new ApplicationException("Failed to parse channel information.");
}
}
@@ -426,7 +435,7 @@ namespace MediaBrowser.Plugins.VuPlus
/// <returns>Task{List<ChannelInfo>}.</returns>
public async Task<List<ChannelInfo>> GetChannelsForTVBouquetAsync(CancellationToken cancellationToken, string sRef)
{
_logger.LogInformation("[VuPlus] Start GetChannelsForTVBouquetAsync, retrieve all channels for TV Bouquet " + sRef);
_logger.LogInformation("[Enigma2] Start GetChannelsForTVBouquetAsync, retrieve all channels for TV Bouquet " + sRef);
await EnsureConnectionAsync(cancellationToken).ConfigureAwait(false);
var protocol = "http";
@@ -437,23 +446,23 @@ namespace MediaBrowser.Plugins.VuPlus
var baseUrl = protocol + "://" + Plugin.Instance.Configuration.HostName + ":" + Plugin.Instance.Configuration.WebInterfacePort;
var baseUrlPicon = protocol + "://" + Plugin.Instance.Configuration.WebInterfaceUsername + ":" + Plugin.Instance.Configuration.WebInterfacePassword + "@" + Plugin.Instance.Configuration.HostName + ":" + Plugin.Instance.Configuration.WebInterfacePort;
var baseUrlPicon = baseUrl;
var url = string.Format("{0}/web/getservices?sRef={1}", baseUrl, sRef);
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] GetChannelsForTVBouquetAsync url: {0}", url));
UtilsHelper.DebugInformation(_logger, string.Format("[Enigma2] GetChannelsForTVBouquetAsync url: {0}", url));
if (!string.IsNullOrEmpty(Plugin.Instance.Configuration.WebInterfaceUsername))
{
baseUrlPicon = protocol + "://" + Plugin.Instance.Configuration.WebInterfaceUsername + ":" + Plugin.Instance.Configuration.WebInterfacePassword + "@" + Plugin.Instance.Configuration.HostName + ":" + Plugin.Instance.Configuration.WebInterfacePort;
}
using (var stream = await _httpClient.GetStreamAsync(url, cancellationToken).ConfigureAwait(false))
using (var stream = await GetHttpClient().GetStreamAsync(url, cancellationToken).ConfigureAwait(false))
{
using (var reader = new StreamReader(stream))
{
var xmlResponse = reader.ReadToEnd();
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] GetChannelsForTVBouquetAsync response: {0}", xmlResponse));
UtilsHelper.DebugInformation(_logger, string.Format("[Enigma2] GetChannelsForTVBouquetAsync response: {0}", xmlResponse));
try
{
@@ -529,15 +538,15 @@ namespace MediaBrowser.Plugins.VuPlus
}
else
{
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] ignoring channel {0}", e2servicereference));
UtilsHelper.DebugInformation(_logger, string.Format("[Enigma2] ignoring channel {0}", e2servicereference));
}
}
return channelInfos;
}
catch (Exception e)
{
_logger.LogError("[VuPlus] Failed to parse channel information.");
_logger.LogError(string.Format("[VuPlus] GetChannelsForTVBouquetAsync error: {0}", e.Message));
_logger.LogError("[Enigma2] Failed to parse channel information.");
_logger.LogError(string.Format("[Enigma2] GetChannelsForTVBouquetAsync error: {0}", e.Message));
throw new ApplicationException("Failed to parse channel information.");
}
}
@@ -549,15 +558,16 @@ namespace MediaBrowser.Plugins.VuPlus
/// Gets the Recordings async
/// </summary>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{IEnumerable{RecordingInfo}}</returns>
public async Task<IEnumerable<RecordingInfo>> GetRecordingsAsync(CancellationToken cancellationToken)
/// <returns>Task{IEnumerable{MyRecordingInfo}}</returns>
public async Task<IEnumerable<MyRecordingInfo>> GetRecordingsAsync(CancellationToken cancellationToken)
{
return new List<RecordingInfo>();
await Task.Delay(0); //to avoid await warnings
return new List<MyRecordingInfo>();
}
public async Task<IEnumerable<MyRecordingInfo>> GetAllRecordingsAsync(CancellationToken cancellationToken)
{
_logger.LogInformation("[VuPlus] Start GetRecordingsAsync, retrieve all 'Inprogress' and 'Completed' recordings ");
_logger.LogInformation("[Enigma2] Start GetRecordingsAsync, retrieve all 'Inprogress' and 'Completed' recordings ");
await EnsureConnectionAsync(cancellationToken).ConfigureAwait(false);
var protocol = "http";
@@ -569,14 +579,14 @@ namespace MediaBrowser.Plugins.VuPlus
var baseUrl = protocol + "://" + Plugin.Instance.Configuration.HostName + ":" + Plugin.Instance.Configuration.WebInterfacePort;
var url = string.Format("{0}/web/movielist", baseUrl);
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] GetRecordingsAsync url: {0}", url));
UtilsHelper.DebugInformation(_logger, string.Format("[Enigma2] GetRecordingsAsync url: {0}", url));
using (var stream = await _httpClient.GetStreamAsync(url, cancellationToken).ConfigureAwait(false))
using (var stream = await GetHttpClient().GetStreamAsync(url, cancellationToken).ConfigureAwait(false))
{
using (var reader = new StreamReader(stream))
{
var xmlResponse = reader.ReadToEnd();
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] GetRecordingsAsync response: {0}", xmlResponse));
UtilsHelper.DebugInformation(_logger, string.Format("[Enigma2] GetRecordingsAsync response: {0}", xmlResponse));
try
{
@@ -654,7 +664,7 @@ namespace MediaBrowser.Plugins.VuPlus
{
if (channelInfo.Name == e2servicename)
{
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] GetRecordingsAsync match on channel name : {0} for recording {1}", e2servicename, e2title));
UtilsHelper.DebugInformation(_logger, string.Format("[Enigma2] GetRecordingsAsync match on channel name : {0} for recording {1}", e2servicename, e2title));
recordingInfo.ChannelId = channelInfo.Id;
recordingInfo.ChannelType = channelInfo.ChannelType;
recordingInfo.HasImage = true;
@@ -666,7 +676,7 @@ namespace MediaBrowser.Plugins.VuPlus
if (recordingInfo.ChannelId == null)
{
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] GetRecordingsAsync no match on channel name : {0} for recording {1}", e2servicename, e2title));
UtilsHelper.DebugInformation(_logger, string.Format("[Enigma2] GetRecordingsAsync no match on channel name : {0} for recording {1}", e2servicename, e2title));
}
recordingInfo.CommunityRating = 0;
@@ -720,8 +730,8 @@ namespace MediaBrowser.Plugins.VuPlus
}
catch (Exception e)
{
_logger.LogError("[VuPlus] Failed to parse timer information.");
_logger.LogError(string.Format("[VuPlus] GetRecordingsAsync error: {0}", e.Message));
_logger.LogError("[Enigma2] Failed to parse timer information.");
_logger.LogError(string.Format("[Enigma2] GetRecordingsAsync error: {0}", e.Message));
throw new ApplicationException("Failed to parse timer information.");
}
}
@@ -736,7 +746,7 @@ namespace MediaBrowser.Plugins.VuPlus
/// <returns></returns>
public async Task DeleteRecordingAsync(string recordingId, CancellationToken cancellationToken)
{
_logger.LogInformation(string.Format("[VuPlus] Start Delete Recording Async for recordingId: {0}", recordingId));
_logger.LogInformation(string.Format("[Enigma2] Start Delete Recording Async for recordingId: {0}", recordingId));
await EnsureConnectionAsync(cancellationToken).ConfigureAwait(false);
var protocol = "http";
@@ -748,14 +758,14 @@ namespace MediaBrowser.Plugins.VuPlus
var baseUrl = protocol + "://" + Plugin.Instance.Configuration.HostName + ":" + Plugin.Instance.Configuration.WebInterfacePort;
var url = string.Format("{0}/web/moviedelete?sRef={1}", baseUrl, recordingId);
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] DeleteRecordingAsync url: {0}", url));
UtilsHelper.DebugInformation(_logger, string.Format("[Enigma2] DeleteRecordingAsync url: {0}", url));
using (var stream = await _httpClient.GetStreamAsync(url, cancellationToken).ConfigureAwait(false))
using (var stream = await GetHttpClient().GetStreamAsync(url, cancellationToken).ConfigureAwait(false))
{
using (var reader = new StreamReader(stream))
{
var xmlResponse = reader.ReadToEnd();
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] DeleteRecordingAsync response: {0}", xmlResponse));
UtilsHelper.DebugInformation(_logger, string.Format("[Enigma2] DeleteRecordingAsync response: {0}", xmlResponse));
try
{
@@ -765,7 +775,7 @@ namespace MediaBrowser.Plugins.VuPlus
var e2simplexmlresult = xml.GetElementsByTagName("e2simplexmlresult");
foreach (XmlNode xmlNode in e2simplexmlresult)
{
var recordingInfo = new RecordingInfo();
var recordingInfo = new MyRecordingInfo();
var e2state = "?";
var e2statetext = "?";
@@ -784,16 +794,16 @@ namespace MediaBrowser.Plugins.VuPlus
if (e2state != "True")
{
_logger.LogError("[VuPlus] Failed to delete recording information.");
_logger.LogError(string.Format("[VuPlus] DeleteRecordingAsync e2statetext: {0}", e2statetext));
_logger.LogError("[Enigma2] Failed to delete recording information.");
_logger.LogError(string.Format("[Enigma2] DeleteRecordingAsync e2statetext: {0}", e2statetext));
throw new ApplicationException("Failed to delete recording.");
}
}
}
catch (Exception e)
{
_logger.LogError("[VuPlus] Failed to parse delete recording information.");
_logger.LogError(string.Format("[VuPlus] DeleteRecordingAsync error: {0}", e.Message));
_logger.LogError("[Enigma2] Failed to parse delete recording information.");
_logger.LogError(string.Format("[Enigma2] DeleteRecordingAsync error: {0}", e.Message));
throw new ApplicationException("Failed to parse delete recording information.");
}
}
@@ -809,7 +819,7 @@ namespace MediaBrowser.Plugins.VuPlus
/// <returns></returns>
public async Task CancelTimerAsync(string timerId, CancellationToken cancellationToken)
{
_logger.LogInformation(string.Format("[VuPlus] Start CancelTimerAsync for recordingId: {0}", timerId));
_logger.LogInformation(string.Format("[Enigma2] Start CancelTimerAsync for recordingId: {0}", timerId));
await EnsureConnectionAsync(cancellationToken).ConfigureAwait(false);
// extract sRef, id, begin and end from passed timerId
@@ -828,14 +838,14 @@ namespace MediaBrowser.Plugins.VuPlus
var baseUrl = protocol + "://" + Plugin.Instance.Configuration.HostName + ":" + Plugin.Instance.Configuration.WebInterfacePort;
var url = string.Format("{0}/web/timerdelete?sRef={1}&begin={2}&end={3}", baseUrl, sRef, begin, end);
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] CancelTimerAsync url: {0}", url));
UtilsHelper.DebugInformation(_logger, string.Format("[Enigma2] CancelTimerAsync url: {0}", url));
using (var stream = await _httpClient.GetStreamAsync(url, cancellationToken).ConfigureAwait(false))
using (var stream = await GetHttpClient().GetStreamAsync(url, cancellationToken).ConfigureAwait(false))
{
using (var reader = new StreamReader(stream))
{
var xmlResponse = reader.ReadToEnd();
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] CancelTimerAsync response: {0}", xmlResponse));
UtilsHelper.DebugInformation(_logger, string.Format("[Enigma2] CancelTimerAsync response: {0}", xmlResponse));
try
{
@@ -845,7 +855,7 @@ namespace MediaBrowser.Plugins.VuPlus
var e2simplexmlresult = xml.GetElementsByTagName("e2simplexmlresult");
foreach (XmlNode xmlNode in e2simplexmlresult)
{
var recordingInfo = new RecordingInfo();
var recordingInfo = new MyRecordingInfo();
var e2state = "?";
var e2statetext = "?";
@@ -864,16 +874,16 @@ namespace MediaBrowser.Plugins.VuPlus
if (e2state != "True")
{
_logger.LogError("[VuPlus] Failed to cancel timer.");
_logger.LogError(string.Format("[VuPlus] CancelTimerAsync e2statetext: {0}", e2statetext));
_logger.LogError("[Enigma2] Failed to cancel timer.");
_logger.LogError(string.Format("[Enigma2] CancelTimerAsync e2statetext: {0}", e2statetext));
throw new ApplicationException("Failed to cancel timer.");
}
}
}
catch (Exception e)
{
_logger.LogError("[VuPlus] Failed to parse cancel timer information.");
_logger.LogError(string.Format("[VuPlus] CancelTimerAsync error: {0}", e.Message));
_logger.LogError("[Enigma2] Failed to parse cancel timer information.");
_logger.LogError(string.Format("[Enigma2] CancelTimerAsync error: {0}", e.Message));
throw new ApplicationException("Failed to parse cancel timer information.");
}
}
@@ -889,7 +899,7 @@ namespace MediaBrowser.Plugins.VuPlus
/// <returns></returns>
public async Task CreateTimerAsync(TimerInfo info, CancellationToken cancellationToken)
{
_logger.LogInformation(string.Format("[VuPlus] Start CreateTimerAsync for ChannelId: {0} & Name: {1}", info.ChannelId, info.Name));
_logger.LogInformation(string.Format("[Enigma2] Start CreateTimerAsync for ChannelId: {0} & Name: {1}", info.ChannelId, info.Name));
await EnsureConnectionAsync(cancellationToken).ConfigureAwait(false);
// extract eventid from info.ProgramId
@@ -911,14 +921,14 @@ namespace MediaBrowser.Plugins.VuPlus
url = url + string.Format("&dirname={0}", WebUtility.UrlEncode(Plugin.Instance.Configuration.RecordingPath));
}
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] CreateTimerAsync url: {0}", url));
UtilsHelper.DebugInformation(_logger, string.Format("[Enigma2] CreateTimerAsync url: {0}", url));
using (var stream = await _httpClient.GetStreamAsync(url, cancellationToken).ConfigureAwait(false))
using (var stream = await GetHttpClient().GetStreamAsync(url, cancellationToken).ConfigureAwait(false))
{
using (var reader = new StreamReader(stream))
{
var xmlResponse = reader.ReadToEnd();
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] CancelTimerAsync response: {0}", xmlResponse));
UtilsHelper.DebugInformation(_logger, string.Format("[Enigma2] CancelTimerAsync response: {0}", xmlResponse));
try
{
@@ -928,7 +938,7 @@ namespace MediaBrowser.Plugins.VuPlus
var e2simplexmlresult = xml.GetElementsByTagName("e2simplexmlresult");
foreach (XmlNode xmlNode in e2simplexmlresult)
{
var recordingInfo = new RecordingInfo();
var recordingInfo = new MyRecordingInfo();
var e2state = "?";
var e2statetext = "?";
@@ -947,16 +957,16 @@ namespace MediaBrowser.Plugins.VuPlus
if (e2state != "True")
{
_logger.LogError("[VuPlus] Failed to create timer.");
_logger.LogError(string.Format("[VuPlus] CreateTimerAsync e2statetext: {0}", e2statetext));
_logger.LogError("[Enigma2] Failed to create timer.");
_logger.LogError(string.Format("[Enigma2] CreateTimerAsync e2statetext: {0}", e2statetext));
throw new ApplicationException("Failed to create timer.");
}
}
}
catch (Exception e)
{
_logger.LogError("[VuPlus] Failed to parse create timer information.");
_logger.LogError(string.Format("[VuPlus] CreateTimerAsync error: {0}", e.Message));
_logger.LogError("[Enigma2] Failed to parse create timer information.");
_logger.LogError(string.Format("[Enigma2] CreateTimerAsync error: {0}", e.Message));
throw new ApplicationException("Failed to parse create timer information.");
}
}
@@ -971,7 +981,7 @@ namespace MediaBrowser.Plugins.VuPlus
/// <returns>IEnumerable<TimerInfo></returns>
public async Task<IEnumerable<TimerInfo>> GetTimersAsync(CancellationToken cancellationToken)
{
_logger.LogInformation("[VuPlus] Start GetTimerAsync, retrieve the 'Pending' recordings");
_logger.LogInformation("[Enigma2] Start GetTimerAsync, retrieve the 'Pending' recordings");
await EnsureConnectionAsync(cancellationToken).ConfigureAwait(false);
var protocol = "http";
@@ -983,14 +993,14 @@ namespace MediaBrowser.Plugins.VuPlus
var baseUrl = protocol + "://" + Plugin.Instance.Configuration.HostName + ":" + Plugin.Instance.Configuration.WebInterfacePort;
var url = string.Format("{0}/web/timerlist", baseUrl);
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] GetTimersAsync url: {0}", url));
UtilsHelper.DebugInformation(_logger, string.Format("[Enigma2] GetTimersAsync url: {0}", url));
using (var stream = await _httpClient.GetStreamAsync(url, cancellationToken).ConfigureAwait(false))
using (var stream = await GetHttpClient().GetStreamAsync(url, cancellationToken).ConfigureAwait(false))
{
using (var reader = new StreamReader(stream))
{
var xmlResponse = reader.ReadToEnd();
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] GetTimersAsync response: {0}", xmlResponse));
UtilsHelper.DebugInformation(_logger, string.Format("[Enigma2] GetTimersAsync response: {0}", xmlResponse));
try
{
@@ -1087,15 +1097,15 @@ namespace MediaBrowser.Plugins.VuPlus
}
else
{
_logger.LogInformation("[VuPlus] ignoring timer " + e2name);
_logger.LogInformation("[Enigma2] ignoring timer " + e2name);
}
}
return timerInfos;
}
catch (Exception e)
{
_logger.LogError("[VuPlus] Failed to parse timer information.");
_logger.LogError(string.Format("[VuPlus] GetTimersAsync error: {0}", e.Message));
_logger.LogError("[Enigma2] Failed to parse timer information.");
_logger.LogError(string.Format("[Enigma2] GetTimersAsync error: {0}", e.Message));
throw new ApplicationException("Failed to parse timer information.");
}
}
@@ -1119,25 +1129,43 @@ namespace MediaBrowser.Plugins.VuPlus
/// <returns>MediaSourceInfo</returns>
public async Task<MediaSourceInfo> GetChannelStream(string channelOid, string mediaSourceId, CancellationToken cancellationToken)
{
_logger.LogInformation("[VuPlus] Start GetChannelStream");
_logger.LogInformation("[Enigma2] Start GetChannelStream");
var protocol = "http";
if (Plugin.Instance.Configuration.UseSecureHTTPS)
if (Plugin.Instance.Configuration.UseSecureHTTPSForStreams)
{
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
if (Plugin.Instance.Configuration.ZapToChannel)
{
await ZapToChannel(cancellationToken, channelOid).ConfigureAwait(false);
}
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 + ":" + streamingPort;
}
var trancodingUrl = "";
if (Plugin.Instance.Configuration.TranscodedStream)
{
trancodingUrl = "?bitrate=1000000?width=1280?height=720?vcodec=h264?aspectratio=2?interlaced=0.mp4";
}
_liveStreams++;
var streamUrl = string.Format("{0}/{1}", baseUrl, channelOid);
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] GetChannelStream url: {0}", streamUrl));
var streamUrl = string.Format("{0}/{1}{2}", baseUrl, channelOid, trancodingUrl);
UtilsHelper.DebugInformation(_logger, string.Format("[Enigma2] GetChannelStream url: {0}", streamUrl));
return new MediaSourceInfo
{
@@ -1176,7 +1204,7 @@ namespace MediaBrowser.Plugins.VuPlus
/// <returns></returns>
public async Task ZapToChannel(CancellationToken cancellationToken, string channelOid)
{
_logger.LogInformation("[VuPlus] Start ZapToChannel");
_logger.LogInformation("[Enigma2] Start ZapToChannel");
await EnsureConnectionAsync(cancellationToken).ConfigureAwait(false);
var protocol = "http";
@@ -1188,14 +1216,14 @@ namespace MediaBrowser.Plugins.VuPlus
var baseUrl = protocol + "://" + Plugin.Instance.Configuration.HostName + ":" + Plugin.Instance.Configuration.WebInterfacePort;
var url = string.Format("{0}/web/zap?sRef={1}", baseUrl, channelOid);
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] ZapToChannel url: {0}", url));
UtilsHelper.DebugInformation(_logger, string.Format("[Enigma2] ZapToChannel url: {0}", url));
using (var stream = await _httpClient.GetStreamAsync(url, cancellationToken).ConfigureAwait(false))
using (var stream = await GetHttpClient().GetStreamAsync(url, cancellationToken).ConfigureAwait(false))
{
using (var reader = new StreamReader(stream))
{
var xmlResponse = reader.ReadToEnd();
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] ZapToChannel response: {0}", xmlResponse));
UtilsHelper.DebugInformation(_logger, string.Format("[Enigma2] ZapToChannel response: {0}", xmlResponse));
try
{
@@ -1205,7 +1233,7 @@ namespace MediaBrowser.Plugins.VuPlus
var e2simplexmlresult = xml.GetElementsByTagName("e2simplexmlresult");
foreach (XmlNode xmlNode in e2simplexmlresult)
{
var recordingInfo = new RecordingInfo();
var recordingInfo = new MyRecordingInfo();
var e2state = "?";
var e2statetext = "?";
@@ -1224,16 +1252,16 @@ namespace MediaBrowser.Plugins.VuPlus
if (e2state != "True")
{
_logger.LogError("[VuPlus] Failed to zap to channel.");
_logger.LogError(string.Format("[VuPlus] ZapToChannel e2statetext: {0}", e2statetext));
_logger.LogError("[Enigma2] Failed to zap to channel.");
_logger.LogError(string.Format("[Enigma2] ZapToChannel e2statetext: {0}", e2statetext));
throw new ApplicationException("Failed to zap to channel.");
}
}
}
catch (Exception e)
{
_logger.LogError("[VuPlus] Failed to parse create timer information.");
_logger.LogError(string.Format("[VuPlus] ZapToChannel error: {0}", e.Message));
_logger.LogError("[Enigma2] Failed to parse create timer information.");
_logger.LogError(string.Format("[Enigma2] ZapToChannel error: {0}", e.Message));
throw new ApplicationException("Failed to parse zap to channel information.");
}
}
@@ -1251,8 +1279,9 @@ namespace MediaBrowser.Plugins.VuPlus
/// <returns>SeriesTimerInfo</returns>
public async Task<SeriesTimerInfo> GetNewTimerDefaultsAsync(CancellationToken cancellationToken, ProgramInfo program = null)
{
_logger.LogInformation("[VuPlus] Start GetNewTimerDefaultsAsync");
_logger.LogInformation("[Enigma2] Start GetNewTimerDefaultsAsync");
await Task.Delay(0); //to avoid await warnings
var seriesTimerInfo = new SeriesTimerInfo();
return seriesTimerInfo;
@@ -1269,7 +1298,7 @@ namespace MediaBrowser.Plugins.VuPlus
/// <returns>IEnumerable<ProgramInfo></returns>
public async Task<IEnumerable<ProgramInfo>> GetProgramsAsync(string channelId, DateTime startDateUtc, DateTime endDateUtc, CancellationToken cancellationToken)
{
_logger.LogInformation("[VuPlus] Start GetProgramsAsync");
_logger.LogInformation("[Enigma2] Start GetProgramsAsync");
await EnsureConnectionAsync(cancellationToken).ConfigureAwait(false);
var rnd = new Random();
@@ -1286,14 +1315,14 @@ namespace MediaBrowser.Plugins.VuPlus
var baseUrl = protocol + "://" + Plugin.Instance.Configuration.HostName + ":" + Plugin.Instance.Configuration.WebInterfacePort;
var url = string.Format("{0}/web/epgservice?sRef={1}", baseUrl, channelId);
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] GetProgramsAsync url: {0}", url));
UtilsHelper.DebugInformation(_logger, string.Format("[Enigma2] GetProgramsAsync url: {0}", url));
using (var stream = await _httpClient.GetStreamAsync(url, cancellationToken).ConfigureAwait(false))
using (var stream = await GetHttpClient().GetStreamAsync(url, cancellationToken).ConfigureAwait(false))
{
using (var reader = new StreamReader(stream))
{
var xmlResponse = reader.ReadToEnd();
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] GetProgramsAsync response: {0}", xmlResponse));
UtilsHelper.DebugInformation(_logger, string.Format("[Enigma2] GetProgramsAsync response: {0}", xmlResponse));
try
{
@@ -1365,12 +1394,12 @@ namespace MediaBrowser.Plugins.VuPlus
// Check whether the current element is within the time range passed
if (sdate > endDateUtc)
{
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] GetProgramsAsync epc full ending without adding channel name : {0} program : {1}", e2eventservicename, e2eventtitle));
UtilsHelper.DebugInformation(_logger, string.Format("[Enigma2] GetProgramsAsync epc full ending without adding channel name : {0} program : {1}", e2eventservicename, e2eventtitle));
return programInfos;
}
else
{
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] GetProgramsAsync adding program for channel name : {0} program : {1}", e2eventservicename, e2eventtitle));
UtilsHelper.DebugInformation(_logger, string.Format("[Enigma2] GetProgramsAsync adding program for channel name : {0} program : {1}", e2eventservicename, e2eventtitle));
//programInfo.HasImage = false;
//programInfo.ImagePath = null;
//programInfo.ImageUrl = null;
@@ -1380,7 +1409,7 @@ namespace MediaBrowser.Plugins.VuPlus
{
if (channelInfo.Name == e2eventservicename)
{
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] GetProgramsAsync match on channel name : {0}", e2eventservicename));
UtilsHelper.DebugInformation(_logger, string.Format("[Enigma2] GetProgramsAsync match on channel name : {0}", e2eventservicename));
//programInfo.HasImage = true;
//programInfo.ImagePath = channelInfo.ImagePath;
//programInfo.ImageUrl = channelInfo.ImageUrl;
@@ -1436,8 +1465,8 @@ namespace MediaBrowser.Plugins.VuPlus
}
catch (Exception e)
{
_logger.LogError("[VuPlus] Failed to parse program information.");
_logger.LogError(string.Format("[VuPlus] GetProgramsAsync error: {0}", e.Message));
_logger.LogError("[Enigma2] Failed to parse program information.");
_logger.LogError(string.Format("[Enigma2] GetProgramsAsync error: {0}", e.Message));
throw new ApplicationException("Failed to parse channel information.");
}
}
@@ -1450,9 +1479,9 @@ namespace MediaBrowser.Plugins.VuPlus
/// </summary>
/// <param name="cancellationToken">The CancellationToken</param>
/// <returns>LiveTvServiceStatusInfo</returns>
public async Task<LiveTvServiceStatusInfo> GetStatusInfoAsync(CancellationToken cancellationToken)
/*public async Task<LiveTvServiceStatusInfo> GetStatusInfoAsync(CancellationToken cancellationToken)
{
_logger.LogInformation("[VuPlus] Start GetStatusInfoAsync Async, retrieve status details");
_logger.LogInformation("[Enigma2] Start GetStatusInfoAsync Async, retrieve status details");
await EnsureConnectionAsync(cancellationToken).ConfigureAwait(false);
//TODO: Version check
@@ -1469,7 +1498,7 @@ namespace MediaBrowser.Plugins.VuPlus
var baseUrl = protocol + "://" + Plugin.Instance.Configuration.HostName + ":" + Plugin.Instance.Configuration.WebInterfacePort;
var url = string.Format("{0}/web/deviceinfo", baseUrl);
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] GetStatusInfoAsync url: {0}", url));
UtilsHelper.DebugInformation(_logger, string.Format("[Enigma2] GetStatusInfoAsync url: {0}", url));
var liveTvTunerInfos = new List<LiveTvTunerInfo>();
@@ -1478,7 +1507,7 @@ namespace MediaBrowser.Plugins.VuPlus
using (var reader = new StreamReader(stream))
{
var xmlResponse = reader.ReadToEnd();
UtilsHelper.DebugInformation(_logger, string.Format("[VuPlus] GetStatusInfoAsync response: {0}", xmlResponse));
UtilsHelper.DebugInformation(_logger, string.Format("[Enigma2] GetStatusInfoAsync response: {0}", xmlResponse));
try
{
@@ -1522,45 +1551,51 @@ namespace MediaBrowser.Plugins.VuPlus
}
catch (Exception e)
{
_logger.LogError("[VuPlus] Failed to parse tuner information.");
_logger.LogError(string.Format("[VuPlus] GetStatusInfoAsync error: {0}", e.Message));
_logger.LogError("[Enigma2] Failed to parse tuner information.");
_logger.LogError(string.Format("[Enigma2] GetStatusInfoAsync error: {0}", e.Message));
throw new ApplicationException("Failed to parse tuner information.");
}
}
}
}
}*/
/// <summary>
/// Gets the homepage url.
/// </summary>
/// <value>The homepage url.</value>
public string HomePageUrl => "http://www.VuPlus.com/";
public string HomePageUrl => "https://github.com/oe-alliance";
/// <summary>
/// Gets the name.
/// </summary>
/// <value>The name.</value>
public string Name => "VuPlus";
public string Name => "Enigma2";
public async Task<MediaSourceInfo> GetRecordingStream(string recordingId, string mediaSourceId, CancellationToken cancellationToken)
{
await Task.Delay(0); //to avoid await warnings
throw new NotImplementedException();
}
public async Task CloseLiveStream(string id, CancellationToken cancellationToken)
{
throw new NotImplementedException();
await Task.Factory.StartNew<string>(() =>
{
_logger.LogDebug("[Enigma2] LiveTvService.CloseLiveStream: closed stream for subscriptionId: {id}", id);
return id;
});
}
public async Task CopyFilesAsync(StreamReader source, StreamWriter destination)
{
_logger.LogInformation("[VuPlus] Start CopyFiles Async");
_logger.LogInformation("[Enigma2] Start CopyFiles Async");
var buffer = new char[0x1000];
int numRead;
while ((numRead = await source.ReadAsync(buffer, 0, buffer.Length)) != 0)
@@ -1583,8 +1618,8 @@ namespace MediaBrowser.Plugins.VuPlus
/// <returns></returns>
public async Task<IEnumerable<SeriesTimerInfo>> GetSeriesTimersAsync(CancellationToken cancellationToken)
{
_logger.LogInformation("[VuPlus] Start GetSeriesTimersAsync");
_logger.LogInformation("[Enigma2] Start GetSeriesTimersAsync");
await Task.Delay(0); //to avoid await warnings
var seriesTimerInfo = new List<SeriesTimerInfo>();
return seriesTimerInfo;
}
@@ -1598,6 +1633,7 @@ namespace MediaBrowser.Plugins.VuPlus
/// <returns></returns>
public async Task CreateSeriesTimerAsync(SeriesTimerInfo info, CancellationToken cancellationToken)
{
await Task.Delay(0); //to avoid await warnings
throw new NotImplementedException();
}
@@ -1610,6 +1646,7 @@ namespace MediaBrowser.Plugins.VuPlus
/// <returns></returns>
public async Task UpdateSeriesTimerAsync(SeriesTimerInfo info, CancellationToken cancellationToken)
{
await Task.Delay(0); //to avoid await warnings
throw new NotImplementedException();
}
@@ -1622,6 +1659,7 @@ namespace MediaBrowser.Plugins.VuPlus
/// <returns></returns>
public async Task UpdateTimerAsync(TimerInfo info, CancellationToken cancellationToken)
{
await Task.Delay(0); //to avoid await warnings
throw new NotImplementedException();
}
@@ -1634,48 +1672,32 @@ namespace MediaBrowser.Plugins.VuPlus
/// <returns></returns>
public async Task CancelSeriesTimerAsync(string timerId, CancellationToken cancellationToken)
{
await Task.Delay(0); //to avoid await warnings
throw new NotImplementedException();
}
/// <summary>
/// Get the DefaultScheduleSettings
/// </summary>
/// <param name="cancellationToken">The CancellationToken</param>
/// <returns></returns>
//private async Task<ScheduleSettings> GetDefaultScheduleSettings(CancellationToken cancellationToken)
//{
// throw new NotImplementedException();
//}
public event EventHandler DataSourceChanged;
public event EventHandler<RecordingStatusChangedEventArgs> RecordingStatusChanged;
public Task ResetTuner(string id, CancellationToken cancellationToken)
{
throw new NotImplementedException();
}
public Task<ImageStream> GetChannelImageAsync(string channelId, CancellationToken cancellationToken)
public Task<Stream> GetChannelImageAsync(string channelId, CancellationToken cancellationToken)
{
// Leave as is. This is handled by supplying image url to ChannelInfo
throw new NotImplementedException();
}
public Task<ImageStream> GetProgramImageAsync(string programId, string channelId, CancellationToken cancellationToken)
public Task<Stream> GetProgramImageAsync(string programId, string channelId, CancellationToken cancellationToken)
{
// Leave as is. This is handled by supplying image url to ProgramInfo
throw new NotImplementedException();
}
public Task<ImageStream> GetRecordingImageAsync(string recordingId, CancellationToken cancellationToken)
public Task<Stream> GetRecordingImageAsync(string recordingId, CancellationToken cancellationToken)
{
// Leave as is. This is handled by supplying image url to RecordingInfo
throw new NotImplementedException();
@@ -4,9 +4,9 @@ using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Plugins;
using MediaBrowser.Model.Plugins;
using MediaBrowser.Model.Serialization;
using MediaBrowser.Plugins.VuPlus.Configuration;
using Jellyfin.Plugin.Enigma2.Configuration;
namespace MediaBrowser.Plugins.VuPlus
namespace Jellyfin.Plugin.Enigma2
{
/// <summary>
/// Class Plugin
@@ -25,15 +25,15 @@ namespace MediaBrowser.Plugins.VuPlus
/// Gets the name of the plugin
/// </summary>
/// <value>The name.</value>
public override string Name => "VuPlus";
public override string Name => "Enigma2";
/// <summary>
/// Gets the description.
/// </summary>
/// <value>The description.</value>
public override string Description => "Provides live tv using Vu+ / Enigma2 pvr as a back-end.";
public override string Description => "Provides live TV using Enigma2 PVR as a back-end.";
private Guid _id = new Guid("9564ac10-af23-39bc-449f-624f23cfa48f");
private Guid _id = new Guid("193f29f9-ea6c-4595-a6f6-55e79d7c590a");
public override Guid Id => _id;
/// <summary>
@@ -48,8 +48,8 @@ namespace MediaBrowser.Plugins.VuPlus
{
new PluginPageInfo
{
Name = "vuplus",
EmbeddedResourcePath = "MediaBrowser.Plugins.VuPlus.Configuration.configPage.html"
Name = "enigma2",
EmbeddedResourcePath = "Jellyfin.Plugin.Enigma2.Configuration.configPage.html"
}
};
}
@@ -7,30 +7,31 @@ using System.Threading.Tasks;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Channels;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.LiveTv;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Channels;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.LiveTv;
using MediaBrowser.Model.MediaInfo;
using Microsoft.Extensions.Logging;
namespace MediaBrowser.Plugins.VuPlus
namespace Jellyfin.Plugin.Enigma2
{
public class RecordingsChannel : IChannel, IHasCacheKey, ISupportsDelete, ISupportsLatestMedia, ISupportsMediaProbe, IHasFolderAttributes
{
public ILiveTvManager _liveTvManager;
private readonly ILogger<LiveTvService> _logger;
public RecordingsChannel(ILiveTvManager liveTvManager)
public RecordingsChannel(ILoggerFactory loggerFactory)
{
_liveTvManager = liveTvManager;
_logger = loggerFactory.CreateLogger<LiveTvService>();
_logger.LogDebug("[Enigma2] RecordingsChannel()");
}
public string Name => "VuPlus Recordings";
public string Name => "Enigma2 Recordings";
public string[] Attributes => new[] { "Recordings" };
public string Description => "VuPlus Recordings";
public string Description => "Enigma2 Recordings";
public string DataVersion => "1";
@@ -110,7 +111,7 @@ namespace MediaBrowser.Plugins.VuPlus
private LiveTvService GetService()
{
return _liveTvManager.Services.OfType<LiveTvService>().First();
return LiveTvService.Instance;
}
public bool CanDelete(BaseItem item)
@@ -181,14 +182,10 @@ namespace MediaBrowser.Plugins.VuPlus
var service = GetService();
var allRecordings = await service.GetAllRecordingsAsync(cancellationToken).ConfigureAwait(false);
var result = new ChannelItemResult()
return new ChannelItemResult()
{
Items = new List<ChannelItemInfo>()
Items = allRecordings.Where(filter).Select(ConvertToChannelItem).ToList()
};
result.Items.AddRange(allRecordings.Where(filter).Select(ConvertToChannelItem));
return result;
}
private ChannelItemInfo ConvertToChannelItem(MyRecordingInfo item)
@@ -207,7 +204,7 @@ namespace MediaBrowser.Plugins.VuPlus
//HomePageUrl = item.HomePageUrl
Id = item.Id,
//IndexNumber = item.IndexNumber,
MediaType = item.ChannelType == Model.LiveTv.ChannelType.TV ? ChannelMediaType.Video : ChannelMediaType.Audio,
MediaType = item.ChannelType == ChannelType.TV ? ChannelMediaType.Video : ChannelMediaType.Audio,
MediaSources = new List<MediaSourceInfo>
{
new MediaSourceInfo
@@ -225,7 +222,7 @@ namespace MediaBrowser.Plugins.VuPlus
DateModified = item.DateLastUpdated,
Overview = item.Overview,
//People = item.People
IsLiveStream = item.Status == Model.LiveTv.RecordingStatus.InProgress,
IsLiveStream = item.Status == RecordingStatus.InProgress,
Etag = item.Status.ToString()
};
@@ -237,16 +234,14 @@ namespace MediaBrowser.Plugins.VuPlus
var service = GetService();
var allRecordings = await service.GetAllRecordingsAsync(cancellationToken).ConfigureAwait(false);
var result = new ChannelItemResult()
{
Items = new List<ChannelItemInfo>()
};
var series = allRecordings
.Where(i => i.IsSeries)
.ToLookup(i => i.Name, StringComparer.OrdinalIgnoreCase);
result.Items.AddRange(series.OrderBy(i => i.Key).Select(i => new ChannelItemInfo
var items = new List<ChannelItemInfo>();
items.AddRange(series.OrderBy(i => i.Key).Select(i => new ChannelItemInfo
{
Name = i.Key,
FolderType = ChannelFolderType.Container,
@@ -259,7 +254,7 @@ namespace MediaBrowser.Plugins.VuPlus
if (kids != null)
{
result.Items.Add(new ChannelItemInfo
items.Add(new ChannelItemInfo
{
Name = "Kids",
FolderType = ChannelFolderType.Container,
@@ -272,7 +267,7 @@ namespace MediaBrowser.Plugins.VuPlus
var movies = allRecordings.FirstOrDefault(i => i.IsMovie);
if (movies != null)
{
result.Items.Add(new ChannelItemInfo
items.Add(new ChannelItemInfo
{
Name = "Movies",
FolderType = ChannelFolderType.Container,
@@ -285,7 +280,7 @@ namespace MediaBrowser.Plugins.VuPlus
var news = allRecordings.FirstOrDefault(i => i.IsNews);
if (news != null)
{
result.Items.Add(new ChannelItemInfo
items.Add(new ChannelItemInfo
{
Name = "News",
FolderType = ChannelFolderType.Container,
@@ -298,7 +293,7 @@ namespace MediaBrowser.Plugins.VuPlus
var sports = allRecordings.FirstOrDefault(i => i.IsSports);
if (sports != null)
{
result.Items.Add(new ChannelItemInfo
items.Add(new ChannelItemInfo
{
Name = "Sports",
FolderType = ChannelFolderType.Container,
@@ -311,7 +306,7 @@ namespace MediaBrowser.Plugins.VuPlus
var other = allRecordings.FirstOrDefault(i => !i.IsSports && !i.IsNews && !i.IsMovie && !i.IsKids && !i.IsSeries);
if (other != null)
{
result.Items.Add(new ChannelItemInfo
items.Add(new ChannelItemInfo
{
Name = "Others",
FolderType = ChannelFolderType.Container,
@@ -321,7 +316,10 @@ namespace MediaBrowser.Plugins.VuPlus
});
}
return result;
return new ChannelItemResult()
{
Items = items
};
}
}
public class MyRecordingInfo
@@ -0,0 +1,20 @@
using MediaBrowser.Controller.Channels;
using MediaBrowser.Controller.LiveTv;
using MediaBrowser.Controller.Plugins;
using MediaBrowser.Controller;
using Microsoft.Extensions.DependencyInjection;
using System.Net.Http;
using Jellyfin.Plugin.Enigma2.Helpers;
namespace Jellyfin.Plugin.Enigma2
{
public class ServiceRegistrator : IPluginServiceRegistrator
{
/// <inheritdoc />
public void RegisterServices(IServiceCollection serviceCollection, IServerApplicationHost applicationHost)
{
serviceCollection.AddSingleton<ILiveTvService, LiveTvService>();
serviceCollection.AddSingleton<IChannel, RecordingsChannel>();
}
}
}
+8 -8
View File
@@ -1,27 +1,27 @@
---
# The name of the plugin; official plugins always start "jellyfin-plugin-"
name: "jellyfin-plugin-vuplus"
name: "jellyfin-plugin-enigma2"
# The GUID of the plugin, found in Plugin.cs
guid: "9564ac10-af23-39bc-449f-624f23cfa48f"
guid: "193f29f9-ea6c-4595-a6f6-55e79d7c590a"
# The version of the plugin, starting at 1. Note that the AssemblyVersion
# and FileVersion flags in the `.csproj` file must have two additional
# fiels, e.g. 1.0.0 to be built correctly.
version: "4.0.0.0" # Please increment with each pull request
version: "5.0.1.0" # Please increment with each pull request
# The supported Jellyfin version, usually the earliest binary-compatible
# version. Based on the Jellyfin components from NuGet.
targetAbi: "10.7.0.0" # The earliest binary-compatible version
targetAbi: "10.8.0.0" # The earliest binary-compatible version
framework: "net5.0"
framework: "net6.0"
# The owner name of the plugin, "jellyfin" for official plugins. Change
# to your own name if you wish to remain a 3rd-party plugin.
owner: "knackebrot"
# A short description of the plugin
overview: "VU+"
overview: "Enigma2"
# A longer and more detailed description of the plugin; use multiple
# lines as required for readability.
@@ -35,10 +35,10 @@ category: "Live TV"
# Include the main output file, as well as any dependency `.dll`s that
# might be required for the plugin to run.
artifacts:
- "MediaBrowser.Plugins.VuPlus.dll"
- "Jellyfin.Plugin.Enigma2.dll"
# Build information values for the build infrastructure; these should
# not need to be changed usually.
build_type: "dotnet"
dotnet_configuration: "Release"
dotnet_framework: "net5.0"
dotnet_framework: "net6.0"