Merge pull request #5 from telans/master

update readme
This commit is contained in:
dkanada 2020-03-26 02:13:07 +09:00 committed by GitHub
commit 655f861861
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 55 additions and 89 deletions

View File

@ -9,7 +9,9 @@ namespace NextPvr.Configuration
public class PluginConfiguration : BasePluginConfiguration
{
public string WebServiceUrl { get; set; }
public string Pin { get; set; }
public Boolean EnableDebugLogging { get; set; }
public PluginConfiguration()

View File

@ -5,7 +5,6 @@
</head>
<body>
<div data-role="page" class="page type-interior pluginConfigurationPage nextpvrConfigurationPage" data-require="emby-button,emby-input,emby-checkbox">
<div data-role="content">
<div class="content-primary">
<form class="nextpvrConfigurationForm">
@ -13,41 +12,34 @@
<div class="inputContainer">
<input is="emby-input" type="text" id="txtWebServiceUrl" label="NextPVR base url:" />
<div class="fieldDescription">
NextPVR backend url (format --> http://{hostname}:{port}).
NextPVR URL
</div>
</div>
<div class="inputContainer">
<input is="emby-input" type="text" id="txtPin" label="NextPVR pin:" />
<div class="fieldDescription">
NextPVR pin to access the nextpvr backend.
NextPVR PIN
</div>
</div>
<label class="checkboxContainer">
<input is="emby-checkbox" type="checkbox" id="chkDebugLogging" />
<span>Enable NextPVR debug logging</span>
<span>NextPVR Debug Logging</span>
</label>
<button is="emby-button" type="submit" class="raised button-submit block"><span>Save</span></button>
</form>
</div>
</div>
<script type="text/javascript">
var NextPvrConfigurationPage = {
pluginUniqueId: "9574ac10-bf23-49bc-949f-924f23cfa48f"
};
$('.nextpvrConfigurationPage').on('pageshow', function (event) {
Dashboard.showLoadingMsg();
var page = this;
ApiClient.getPluginConfiguration(NextPvrConfigurationPage.pluginUniqueId).then(function (config) {
$('#txtWebServiceUrl', page).val(config.WebServiceUrl || "");
$('#txtPin', page).val(config.Pin || "");
$('#chkDebugLogging', page).checked(config.EnableDebugLogging || false).checkboxradio("refresh");
@ -57,13 +49,10 @@
});
$('.nextpvrConfigurationForm').on('submit', function (e) {
Dashboard.showLoadingMsg();
var form = this;
ApiClient.getPluginConfiguration(NextPvrConfigurationPage.pluginUniqueId).then(function (config) {
config.WebServiceUrl = $('#txtWebServiceUrl', form).val();
config.Pin = $('#txtPin', form).val();
config.EnableDebugLogging = $('#chkDebugLogging', form).checked();

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NextPvr.Helpers
namespace NextPvr.Helpers
{
public class DateTimeHelper
{
@ -13,7 +13,7 @@ using System.Threading.Tasks;
//create Timespan by subtracting the value provided from the Unix Epoch
TimeSpan span = (utcTime - new DateTime(1970, 1, 1, 0, 0, 0, 0));
//return the total seconds (which is a UNIX timestamp)
//return the total seconds (which is a UNIX timestamp)
return (long)span.TotalSeconds;
}
}

View File

@ -259,6 +259,7 @@ namespace NextPvr
_logger.LogError(string.Format("[NextPvr] Failed to delete the recording for recordingId: {0}", recordingId));
throw new Exception(string.Format("Failed to delete the recording for recordingId: {0}", recordingId));
}
_logger.LogInformation("[NextPvr] Deleted Recording with recordingId: {0}", recordingId);
}
}
@ -301,6 +302,7 @@ namespace NextPvr
_logger.LogError(string.Format("[NextPvr] Failed to cancel the recording for recordingId: {0}", timerId));
throw new Exception(string.Format("Failed to cancel the recording for recordingId: {0}", timerId));
}
_logger.LogInformation(string.Format("[NextPvr] Cancelled Recording for recordingId: {0}", timerId));
}
}
@ -656,6 +658,7 @@ namespace NextPvr
_logger.LogError(string.Format("[NextPvr] Failed to cancel the recording with recordingId: {0}", timerId));
throw new Exception(string.Format("Failed to cancel the recording with recordingId: {0}", timerId));
}
_logger.LogInformation("[NextPvr] Cancelled Recording for recordingId: {0}", timerId);
}
}
@ -928,5 +931,4 @@ namespace NextPvr
throw new NotImplementedException();
}
}
}

View File

@ -8,16 +8,14 @@
<ItemGroup>
<None Remove="Configuration\configPage.html" />
<None Remove="thumb.png" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Configuration\configPage.html" />
<EmbeddedResource Include="thumb.png" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Jellyfin.Controller" Version="10.4-*" />
<PackageReference Include="Jellyfin.Controller" Version="10.5.*" />
<PackageReference Include="System.Memory" Version="4.5.1" />
</ItemGroup>

View File

@ -56,7 +56,7 @@ namespace NextPvr
{
get
{
return "Provides live tv using next pvr as a back-end.";
return "Provides live TV using NextPVR as the backend.";
}
}

View File

@ -31,7 +31,7 @@ namespace NextPvr
{
get
{
return "Next Pvr Recordings";
return "NextPVR Recordings";
}
}
@ -39,7 +39,7 @@ namespace NextPvr
{
get
{
return "Next Pvr Recordings";
return "NextPVR Recordings";
}
}
@ -61,7 +61,7 @@ namespace NextPvr
public string HomePageUrl
{
get { return "http://www.nextpvr.com/"; }
get { return "http://www.nextpvr.com"; }
}
public ChannelParentalRating ParentalRating
@ -93,16 +93,16 @@ namespace NextPvr
return new InternalChannelFeatures
{
ContentTypes = new List<ChannelMediaContentType>
{
ChannelMediaContentType.Movie,
ChannelMediaContentType.Episode,
{
ChannelMediaContentType.Movie,
ChannelMediaContentType.Episode,
ChannelMediaContentType.Clip
},
},
MediaTypes = new List<ChannelMediaType>
{
ChannelMediaType.Audio,
ChannelMediaType.Video
},
{
ChannelMediaType.Audio,
ChannelMediaType.Video
},
SupportsContentDownloading = true
};
}
@ -354,6 +354,7 @@ namespace NextPvr
return result;
}
}
public class MyRecordingInfo
{
/// <summary>
@ -535,6 +536,7 @@ namespace NextPvr
/// </summary>
/// <value><c>null</c> if [has image] contains no value, <c>true</c> if [has image]; otherwise, <c>false</c>.</value>
public bool? HasImage { get; set; }
/// <summary>
/// Gets or sets the show identifier.
/// </summary>
@ -552,5 +554,4 @@ namespace NextPvr
Genres = new List<string>();
}
}
}

View File

@ -21,6 +21,7 @@ namespace NextPvr.Responses
UtilsHelper.DebugInformation(logger,string.Format("[NextPvr] RecordingError Response: {0}", json.SerializeToString(root)));
return root.epgEventJSONObject.rtn.Error;
}
return null;
}

View File

@ -79,8 +79,5 @@ namespace NextPvr.Responses
{
public ChannelsJSONObject channelsJSONObject { get; set; }
}
}
}

View File

@ -16,6 +16,7 @@ namespace NextPvr.Responses
{
_baseUrl = baseUrl;
}
private class Rules
{
public string ChannelOID { get; set; }
@ -28,7 +29,6 @@ namespace NextPvr.Responses
public string Keep { get; set; }
public string Days { get; set; }
public string EPGTitle { get; set; }
}
private class RulesXmlDoc
@ -57,7 +57,6 @@ namespace NextPvr.Responses
public string Day { get; set; }
public object AdvancedRules { get; set; }
public RulesXmlDoc RulesXmlDoc { get; set; }
}
private class Rtn
@ -87,7 +86,6 @@ namespace NextPvr.Responses
public bool FirstRun { get; set; }
public bool HasSchedule { get; set; }
public bool ScheduleIsRecurring { get; set; }
}
private class Schd

View File

@ -17,6 +17,7 @@ namespace NextPvr.Responses
UtilsHelper.DebugInformation(logger,string.Format("[NextPvr] Connection validation: {0}", json.SerializeToString(root)));
return root.SIDValidation.validated;
}
logger.LogError("[NextPvr] Failed to validate your connection with NextPvr.");
throw new Exception("Failed to validate your connection with NextPvr.");
}

View File

@ -17,6 +17,7 @@ namespace NextPvr.Responses
UtilsHelper.DebugInformation(logger,string.Format("[NextPvr] ClientKeys: {0}", json.SerializeToString(root)));
return root.clientKeys;
}
logger.LogError("[NextPvr] Failed to load the ClientKeys from NextPvr.");
throw new Exception("Failed to load the ClientKeys from NextPvr.");
}

View File

@ -310,7 +310,6 @@ namespace NextPvr.Responses
public string Keep { get; set; }
public string Days { get; set; }
public string EPGTitle { get; set; }
}
private class RulesXmlDoc
@ -339,7 +338,6 @@ namespace NextPvr.Responses
public string Day { get; set; }
public object AdvancedRules { get; set; }
public RulesXmlDoc RulesXmlDoc { get; set; }
}
private class Rtn
@ -369,7 +367,6 @@ namespace NextPvr.Responses
public bool FirstRun { get; set; }
public bool HasSchedule { get; set; }
public bool ScheduleIsRecurring { get; set; }
}
private class Schd

View File

@ -15,8 +15,8 @@ namespace NextPvr.Responses
public TunerResponse(Stream stream, IJsonSerializer json)
{
_root = json.DeserializeFromStream<RootObject>(stream);
}
public List<LiveTvTunerInfo> LiveTvTunerInfos()
{
return _root.Tuners.Select(GetTunerInformation).ToList();

View File

@ -20,12 +20,14 @@ namespace NextPvr.Responses
logger.LogError("[NextPvr] Failed to load the VLC from NEWA");
throw new Exception("Failed to load the VLC from NEWA.");
}
public Rtn GetVLCReturn(Stream stream, IJsonSerializer json, ILogger logger)
{
var root = json.DeserializeFromStream<RootObject>(stream);
UtilsHelper.DebugInformation(logger,string.Format("[NextPvr] VLC Return: {0}", json.SerializeToString(root)));
return root.JSONVlcObject.rtn;
}
public class VLCObj
{
public bool isVlcAvailable { get; set; }

View File

@ -11,15 +11,15 @@ namespace NextPvr.Responses
public VersionCheckResponse(Stream stream, IJsonSerializer json)
{
_root = json.DeserializeFromStream<RootObject>(stream);
}
public Boolean UpdateAvailable()
{
if (_root.versionCheck != null)
{
return _root.versionCheck.upgradeAvailable;
}
throw new Exception("Failed to get the Update Status from NextPvr.");
}
@ -29,10 +29,10 @@ namespace NextPvr.Responses
{
return _root.versionCheck.serverVer;
}
throw new Exception("Failed to get the Server Version from NextPvr.");
}
public class VersionCheck
{
public bool upgradeAvailable { get; set; }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

View File

@ -1,7 +1,18 @@
# NextPVR Plugin for Jellyfin
<h1 align="center">Jellyfin NextPVR Plugin</h1>
<h3 align="center">Part of the <a href="https://jellyfin.org">Jellyfin Project</a></h3>
## Requirements
[.NET Core 2.2](https://dotnet.microsoft.com/download/dotnet-core/2.2)
## About
## Build
`dotnet build`
The Jellyfin NextPVR plugin can be used for watching media provided by a <a href="http://www.nextpvr.com/">NextPVR</a> server.
## Build & Installation Process
1. Clone this repository
2. Ensure you have .NET Core SDK set up and installed
3. Build the plugin with your favorite IDE or the `dotnet` command
```sh
dotnet publish --configuration Release --output bin
```
4. Place the resulting `Jellyfin.Plugin.NextPvr.dll` file in a folder called `plugins/` inside your Jellyfin data directory

View File

@ -1,34 +0,0 @@
# ASP.NET Core (.NET Framework)
# Build and test ASP.NET Core projects targeting the full .NET Framework.
# Add steps that publish symbols, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
- master
pool:
vmImage: 'windows-latest'
variables:
solution: '**/*.sln'
buildPlatform: 'Any CPU'
buildConfiguration: 'Release'
steps:
- task: NuGetToolInstaller@0
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
- task: VSBuild@1
inputs:
solution: '$(solution)'
msbuildArgs: '/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactStagingDirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
- task: VSTest@2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'

View File

@ -1,12 +1,12 @@
---
name: "jellyfin-plugin-nextpvr"
guid: "9574ac10-bf23-49bc-949f-924f23cfa48f"
version: "3" # Please increment with each pull request
jellyfin_version: "10.5.0" # The earliest binary-compatible version
version: "3"
jellyfin_version: "10.5.0"
nicename: "NextPVR"
description: "Jellyfin LiveTV plugin for NextPVR"
description: "Live TV plugin for NextPVR"
overview: >
Provides access to LiveTV, Program Guide and Recordings from NextPVR.
Provides access to live TV, program guide, and recordings from NextPVR.
category: "LiveTV"
owner: "jellyfin"
artifacts: