From 9f98f49c707827ad4dcc79e03dec4deff6b79dc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20F=C3=A4th?= Date: Thu, 9 May 2019 13:54:19 +0200 Subject: [PATCH 01/11] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..cc829ca --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,34 @@ +# 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)' From 26e1fa5033d7321aaac8e829cc831284306d6e50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20F=C3=A4th?= Date: Thu, 9 May 2019 12:02:16 +0000 Subject: [PATCH 02/11] Migrate --- ...ns.PushBulletNotifications.sln => Pushbullet.sln | 4 ++-- .../Api/ServerApiEntryPoints.cs | 6 +++--- .../Configuration/PluginConfiguration.cs | 4 ++-- .../Configuration/config.html | 0 .../Notifier.cs | 6 +++--- .../Plugin.cs | 6 +++--- .../Pushbullet.csproj | 0 .../thumb.jpg | Bin 8 files changed, 13 insertions(+), 13 deletions(-) rename MediaBrowser.Plugins.PushBulletNotifications.sln => Pushbullet.sln (79%) rename {MediaBrowser.Plugins.PushBulletNotifications => Pushbullet}/Api/ServerApiEntryPoints.cs (93%) rename {MediaBrowser.Plugins.PushBulletNotifications => Pushbullet}/Configuration/PluginConfiguration.cs (86%) rename {MediaBrowser.Plugins.PushBulletNotifications => Pushbullet}/Configuration/config.html (100%) rename {MediaBrowser.Plugins.PushBulletNotifications => Pushbullet}/Notifier.cs (93%) rename {MediaBrowser.Plugins.PushBulletNotifications => Pushbullet}/Plugin.cs (92%) rename MediaBrowser.Plugins.PushBulletNotifications/MediaBrowser.Plugins.PushBulletNotifications.csproj => Pushbullet/Pushbullet.csproj (100%) rename {MediaBrowser.Plugins.PushBulletNotifications => Pushbullet}/thumb.jpg (100%) diff --git a/MediaBrowser.Plugins.PushBulletNotifications.sln b/Pushbullet.sln similarity index 79% rename from MediaBrowser.Plugins.PushBulletNotifications.sln rename to Pushbullet.sln index fe2de40..6653137 100644 --- a/MediaBrowser.Plugins.PushBulletNotifications.sln +++ b/Pushbullet.sln @@ -1,9 +1,9 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 VisualStudioVersion = 15.0.26730.3 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MediaBrowser.Plugins.PushBulletNotifications", "MediaBrowser.Plugins.PushBulletNotifications\MediaBrowser.Plugins.PushBulletNotifications.csproj", "{DFC6982E-A548-4599-B612-41D307623364}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Pushbullet", "Pushbullet\Pushbullet.csproj", "{DFC6982E-A548-4599-B612-41D307623364}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/MediaBrowser.Plugins.PushBulletNotifications/Api/ServerApiEntryPoints.cs b/Pushbullet/Api/ServerApiEntryPoints.cs similarity index 93% rename from MediaBrowser.Plugins.PushBulletNotifications/Api/ServerApiEntryPoints.cs rename to Pushbullet/Api/ServerApiEntryPoints.cs index 8dde2a3..193ea5e 100644 --- a/MediaBrowser.Plugins.PushBulletNotifications/Api/ServerApiEntryPoints.cs +++ b/Pushbullet/Api/ServerApiEntryPoints.cs @@ -6,13 +6,13 @@ using System.Text; using MediaBrowser.Common.Net; using MediaBrowser.Controller.Net; -using MediaBrowser.Model.Logging; +using Microsoft.Extensions.Logging; using MediaBrowser.Model.Services; -using MediaBrowser.Plugins.PushBulletNotifications.Configuration; +using Pushbullet.Configuration; using System.Threading; using System.Threading.Tasks; -namespace MediaBrowser.Plugins.PushBulletNotifications.Api +namespace Pushbullet.Api { [Route("/Notification/PushBullet/Test/{UserID}", "POST", Summary = "Tests PushBullet")] public class TestNotification : IReturnVoid diff --git a/MediaBrowser.Plugins.PushBulletNotifications/Configuration/PluginConfiguration.cs b/Pushbullet/Configuration/PluginConfiguration.cs similarity index 86% rename from MediaBrowser.Plugins.PushBulletNotifications/Configuration/PluginConfiguration.cs rename to Pushbullet/Configuration/PluginConfiguration.cs index f5ba8e2..5fb26b8 100644 --- a/MediaBrowser.Plugins.PushBulletNotifications/Configuration/PluginConfiguration.cs +++ b/Pushbullet/Configuration/PluginConfiguration.cs @@ -1,8 +1,8 @@ -using System; +using System; using System.Collections.Generic; using MediaBrowser.Model.Plugins; -namespace MediaBrowser.Plugins.PushBulletNotifications.Configuration +namespace Pushbullet.Configuration { public class PluginConfiguration : BasePluginConfiguration { diff --git a/MediaBrowser.Plugins.PushBulletNotifications/Configuration/config.html b/Pushbullet/Configuration/config.html similarity index 100% rename from MediaBrowser.Plugins.PushBulletNotifications/Configuration/config.html rename to Pushbullet/Configuration/config.html diff --git a/MediaBrowser.Plugins.PushBulletNotifications/Notifier.cs b/Pushbullet/Notifier.cs similarity index 93% rename from MediaBrowser.Plugins.PushBulletNotifications/Notifier.cs rename to Pushbullet/Notifier.cs index 71b3591..758936e 100644 --- a/MediaBrowser.Plugins.PushBulletNotifications/Notifier.cs +++ b/Pushbullet/Notifier.cs @@ -3,14 +3,14 @@ using MediaBrowser.Common.Net; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Notifications; -using MediaBrowser.Model.Logging; -using MediaBrowser.Plugins.PushBulletNotifications.Configuration; +using Microsoft.Extensions.Logging; +using Pushbullet.Configuration; using System; using System.Linq; using System.Threading; using System.Threading.Tasks; -namespace MediaBrowser.Plugins.PushBulletNotifications +namespace Pushbullet { public class Notifier : INotificationService { diff --git a/MediaBrowser.Plugins.PushBulletNotifications/Plugin.cs b/Pushbullet/Plugin.cs similarity index 92% rename from MediaBrowser.Plugins.PushBulletNotifications/Plugin.cs rename to Pushbullet/Plugin.cs index c157b45..fbbe266 100644 --- a/MediaBrowser.Plugins.PushBulletNotifications/Plugin.cs +++ b/Pushbullet/Plugin.cs @@ -1,14 +1,14 @@ -using System; +using System; using System.Collections.Generic; using MediaBrowser.Common.Configuration; using MediaBrowser.Common.Plugins; using MediaBrowser.Model.Plugins; using MediaBrowser.Model.Serialization; -using MediaBrowser.Plugins.PushBulletNotifications.Configuration; +using Pushbullet.Configuration; using MediaBrowser.Model.Drawing; using System.IO; -namespace MediaBrowser.Plugins.PushBulletNotifications +namespace Pushbullet { public class Plugin : BasePlugin, IHasWebPages, IHasThumbImage { diff --git a/MediaBrowser.Plugins.PushBulletNotifications/MediaBrowser.Plugins.PushBulletNotifications.csproj b/Pushbullet/Pushbullet.csproj similarity index 100% rename from MediaBrowser.Plugins.PushBulletNotifications/MediaBrowser.Plugins.PushBulletNotifications.csproj rename to Pushbullet/Pushbullet.csproj diff --git a/MediaBrowser.Plugins.PushBulletNotifications/thumb.jpg b/Pushbullet/thumb.jpg similarity index 100% rename from MediaBrowser.Plugins.PushBulletNotifications/thumb.jpg rename to Pushbullet/thumb.jpg From 4cf55bb17f102062cc41eec9119303f60b795149 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20F=C3=A4th?= Date: Thu, 9 May 2019 12:07:55 +0000 Subject: [PATCH 03/11] csproj --- Pushbullet/Pushbullet.csproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Pushbullet/Pushbullet.csproj b/Pushbullet/Pushbullet.csproj index 4d34749..b8a5b6d 100644 --- a/Pushbullet/Pushbullet.csproj +++ b/Pushbullet/Pushbullet.csproj @@ -2,8 +2,8 @@ netstandard2.0; - 3.1.2.0 - 3.1.2.0 + 1.0.0 + 1.0.0 @@ -17,7 +17,7 @@ - + - + \ No newline at end of file From 43c679272b6faefe17f277ea74603314ccacf535 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20F=C3=A4th?= Date: Thu, 9 May 2019 12:17:52 +0000 Subject: [PATCH 04/11] remove ILogManager --- Pushbullet/Api/ServerApiEntryPoints.cs | 5 ++--- Pushbullet/Notifier.cs | 5 ++--- Pushbullet/Plugin.cs | 16 +--------------- 3 files changed, 5 insertions(+), 21 deletions(-) diff --git a/Pushbullet/Api/ServerApiEntryPoints.cs b/Pushbullet/Api/ServerApiEntryPoints.cs index 193ea5e..6a115f5 100644 --- a/Pushbullet/Api/ServerApiEntryPoints.cs +++ b/Pushbullet/Api/ServerApiEntryPoints.cs @@ -26,10 +26,9 @@ class ServerApiEndpoints : IService private readonly IHttpClient _httpClient; private readonly ILogger _logger; - public ServerApiEndpoints(ILogManager logManager, IHttpClient httpClient) + public ServerApiEndpoints( IHttpClient httpClient) { - _logger = logManager.GetLogger(GetType().Name); - _httpClient = httpClient; + _httpClient = httpClient; } private PushBulletOptions GetOptions(String userID) { diff --git a/Pushbullet/Notifier.cs b/Pushbullet/Notifier.cs index 758936e..9bcb01d 100644 --- a/Pushbullet/Notifier.cs +++ b/Pushbullet/Notifier.cs @@ -17,10 +17,9 @@ public class Notifier : INotificationService private readonly ILogger _logger; private readonly IHttpClient _httpClient; - public Notifier(ILogManager logManager, IHttpClient httpClient) + public Notifier(IHttpClient httpClient) { - _logger = logManager.GetLogger(GetType().Name); - _httpClient = httpClient; + _httpClient = httpClient; } public bool IsEnabledForUser(User user) diff --git a/Pushbullet/Plugin.cs b/Pushbullet/Plugin.cs index fbbe266..05a1565 100644 --- a/Pushbullet/Plugin.cs +++ b/Pushbullet/Plugin.cs @@ -10,7 +10,7 @@ namespace Pushbullet { - public class Plugin : BasePlugin, IHasWebPages, IHasThumbImage + public class Plugin : BasePlugin, IHasWebPages { public Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer) : base(applicationPaths, xmlSerializer) @@ -49,20 +49,6 @@ public override Guid Id get { return _id; } } - public Stream GetThumbImage() - { - var type = GetType(); - return type.Assembly.GetManifestResourceStream(type.Namespace + ".thumb.jpg"); - } - - public ImageFormat ThumbImageFormat - { - get - { - return ImageFormat.Jpg; - } - } - public static Plugin Instance { get; private set; } } } From 5c535d6e94b8d44aa37c6b906272957d6e708c1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20F=C3=A4th?= Date: Thu, 9 May 2019 12:19:42 +0000 Subject: [PATCH 05/11] fix Log --- Pushbullet/Notifier.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pushbullet/Notifier.cs b/Pushbullet/Notifier.cs index 9bcb01d..b6f40aa 100644 --- a/Pushbullet/Notifier.cs +++ b/Pushbullet/Notifier.cs @@ -52,7 +52,7 @@ public async Task SendNotification(UserNotification request, CancellationToken c {"body", request.Description} }; - _logger.Debug("PushBullet to Token : {0} - {1} - {2}", options.Token, options.DeviceId, request.Description); + _logger.LogDebug("PushBullet to Token : {0} - {1} - {2}", options.Token, options.DeviceId, request.Description); var _httpRequest = new HttpRequestOptions(); string authInfo = options.Token; authInfo = Convert.ToBase64String(Encoding.UTF8.GetBytes(authInfo)); From d172c3637e4177a58c9c3c175b2d79b60a0d8d9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20F=C3=A4th?= Date: Thu, 9 May 2019 12:39:19 +0000 Subject: [PATCH 06/11] Test --- Pushbullet/Api/ServerApiEntryPoints.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Pushbullet/Api/ServerApiEntryPoints.cs b/Pushbullet/Api/ServerApiEntryPoints.cs index 6a115f5..da29e3c 100644 --- a/Pushbullet/Api/ServerApiEntryPoints.cs +++ b/Pushbullet/Api/ServerApiEntryPoints.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -26,8 +26,9 @@ class ServerApiEndpoints : IService private readonly IHttpClient _httpClient; private readonly ILogger _logger; - public ServerApiEndpoints( IHttpClient httpClient) + public ServerApiEndpoints(Ilogger logger, IHttpClient httpClient) { + _logger = logger.GetLogger(GetType().Name); _httpClient = httpClient; } private PushBulletOptions GetOptions(String userID) From 430fc97038750a5f1779f6429208f28c1cddc4dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20F=C3=A4th?= Date: Thu, 9 May 2019 12:41:13 +0000 Subject: [PATCH 07/11] log --- Pushbullet/Api/ServerApiEntryPoints.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pushbullet/Api/ServerApiEntryPoints.cs b/Pushbullet/Api/ServerApiEntryPoints.cs index da29e3c..27ffbf1 100644 --- a/Pushbullet/Api/ServerApiEntryPoints.cs +++ b/Pushbullet/Api/ServerApiEntryPoints.cs @@ -26,7 +26,7 @@ class ServerApiEndpoints : IService private readonly IHttpClient _httpClient; private readonly ILogger _logger; - public ServerApiEndpoints(Ilogger logger, IHttpClient httpClient) + public ServerApiEndpoints(ILogger logger, IHttpClient httpClient) { _logger = logger.GetLogger(GetType().Name); _httpClient = httpClient; From 6a26596aadada6f856470938c438287629ad84ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20F=C3=A4th?= Date: Thu, 9 May 2019 12:43:01 +0000 Subject: [PATCH 08/11] Log --- Pushbullet/Api/ServerApiEntryPoints.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Pushbullet/Api/ServerApiEntryPoints.cs b/Pushbullet/Api/ServerApiEntryPoints.cs index 27ffbf1..4b599d7 100644 --- a/Pushbullet/Api/ServerApiEntryPoints.cs +++ b/Pushbullet/Api/ServerApiEntryPoints.cs @@ -28,7 +28,7 @@ class ServerApiEndpoints : IService public ServerApiEndpoints(ILogger logger, IHttpClient httpClient) { - _logger = logger.GetLogger(GetType().Name); + _logger = logger; _httpClient = httpClient; } private PushBulletOptions GetOptions(String userID) From 21377bca800964ef3b3ceb9ce376b0e0f48e9c2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20F=C3=A4th?= Date: Thu, 9 May 2019 12:44:04 +0000 Subject: [PATCH 09/11] Log --- Pushbullet/Notifier.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Pushbullet/Notifier.cs b/Pushbullet/Notifier.cs index b6f40aa..ff7188d 100644 --- a/Pushbullet/Notifier.cs +++ b/Pushbullet/Notifier.cs @@ -17,8 +17,9 @@ public class Notifier : INotificationService private readonly ILogger _logger; private readonly IHttpClient _httpClient; - public Notifier(IHttpClient httpClient) + public Notifier(ILogger logger, IHttpClient httpClient) { + _logger = logger; _httpClient = httpClient; } From 01fbbeb0b4ca7725a577fe0c5c580fb944d6a490 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20F=C3=A4th?= Date: Thu, 9 May 2019 13:22:29 +0000 Subject: [PATCH 10/11] Rename --- Pushbullet/Api/ServerApiEntryPoints.cs | 6 +-- .../Configuration/PluginConfiguration.cs | 6 +-- Pushbullet/Configuration/config.html | 42 +++++++++---------- Pushbullet/Notifier.cs | 6 +-- Pushbullet/Plugin.cs | 4 +- 5 files changed, 32 insertions(+), 32 deletions(-) diff --git a/Pushbullet/Api/ServerApiEntryPoints.cs b/Pushbullet/Api/ServerApiEntryPoints.cs index 4b599d7..69f65ce 100644 --- a/Pushbullet/Api/ServerApiEntryPoints.cs +++ b/Pushbullet/Api/ServerApiEntryPoints.cs @@ -14,7 +14,7 @@ namespace Pushbullet.Api { - [Route("/Notification/PushBullet/Test/{UserID}", "POST", Summary = "Tests PushBullet")] + [Route("/Notification/Pushbullet/Test/{UserID}", "POST", Summary = "Tests Pushbullet")] public class TestNotification : IReturnVoid { [ApiMember(Name = "UserID", Description = "User Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "GET")] @@ -31,7 +31,7 @@ public ServerApiEndpoints(ILogger logger, IHttpClient httpClient) _logger = logger; _httpClient = httpClient; } - private PushBulletOptions GetOptions(String userID) + private PushbulletOptions GetOptions(String userID) { return Plugin.Instance.Configuration.Options .FirstOrDefault(i => string.Equals(i.MediaBrowserUserId, userID, StringComparison.OrdinalIgnoreCase)); @@ -51,7 +51,7 @@ public async Task PostAsync(TestNotification request) { {"type", "note"}, {"title", "Test Notification" }, - {"body", "This is a test notification from MediaBrowser"} + {"body", "This is a test notification from Jellyfin"} }; var _httpRequest = new HttpRequestOptions(); diff --git a/Pushbullet/Configuration/PluginConfiguration.cs b/Pushbullet/Configuration/PluginConfiguration.cs index 5fb26b8..e78a0a7 100644 --- a/Pushbullet/Configuration/PluginConfiguration.cs +++ b/Pushbullet/Configuration/PluginConfiguration.cs @@ -6,15 +6,15 @@ namespace Pushbullet.Configuration { public class PluginConfiguration : BasePluginConfiguration { - public PushBulletOptions[] Options { get; set; } + public PushbulletOptions[] Options { get; set; } public PluginConfiguration() { - Options = new PushBulletOptions[] { }; + Options = new PushbulletOptions[] { }; } } - public class PushBulletOptions + public class PushbulletOptions { public Boolean Enabled { get; set; } public String Token { get; set; } diff --git a/Pushbullet/Configuration/config.html b/Pushbullet/Configuration/config.html index a02d05e..448eb0d 100644 --- a/Pushbullet/Configuration/config.html +++ b/Pushbullet/Configuration/config.html @@ -1,24 +1,24 @@  - PushBullet Notifications + Pushbullet Notifications -
+
-
+
- +
- +
Auth key for your application
@@ -49,21 +49,21 @@ ApiClient.getPluginConfiguration(pluginId).then(function (config) { - var pushBulletConfig = config.Options.filter(function (c) { + var PushbulletConfig = config.Options.filter(function (c) { return userId == c.MediaBrowserUserId; })[0] || {}; - $('#chkEnablePushBullet', page).checked(pushBulletConfig.Enabled || false).checkboxradio("refresh"); - $('#txtPushBulletAuthKey', page).val(pushBulletConfig.Token || ''); - $('#txtPushBulletDeviceId', page).val(pushBulletConfig.DeviceId || ''); + $('#chkEnablePushbullet', page).checked(PushbulletConfig.Enabled || false).checkboxradio("refresh"); + $('#txtPushbulletAuthKey', page).val(PushbulletConfig.Token || ''); + $('#txtPushbulletDeviceId', page).val(PushbulletConfig.DeviceId || ''); Dashboard.hideLoadingMsg(); }); } - $('.pushBulletConfigurationPage').on('pageinit', function (event) { + $('.PushbulletConfigurationPage').on('pageinit', function (event) { var page = this; @@ -96,7 +96,7 @@ ApiClient.ajax({ type: "POST", - url: ApiClient.getUrl("Notification/PushBullet/Test/" + c.MediaBrowserUserId) + url: ApiClient.getUrl("Notification/Pushbullet/Test/" + c.MediaBrowserUserId) }).then(function () { Dashboard.hideLoadingMsg(); @@ -124,7 +124,7 @@ Dashboard.hideLoadingMsg(); }); - $('.pushBulletConfigurationForm').on('submit', function (e) { + $('.PushbulletConfigurationForm').on('submit', function (e) { Dashboard.showLoadingMsg(); @@ -134,22 +134,22 @@ var userId = $('#selectUser', form).val(); - var pushBulletConfig = config.Options.filter(function (c) { + var PushbulletConfig = config.Options.filter(function (c) { return userId == c.MediaBrowserUserId; })[0]; - if (!pushBulletConfig) { - pushBulletConfig = {}; - config.Options.push(pushBulletConfig); + if (!PushbulletConfig) { + PushbulletConfig = {}; + config.Options.push(PushbulletConfig); } - pushBulletConfig.MediaBrowserUserId = userId; + PushbulletConfig.MediaBrowserUserId = userId; - pushBulletConfig.Enabled = $('#chkEnablePushBullet', form).checked(); - pushBulletConfig.Token = $('#txtPushBulletAuthKey', form).val(); - pushBulletConfig.DeviceId = $('#txtPushBulletDeviceId', form).val(); + PushbulletConfig.Enabled = $('#chkEnablePushbullet', form).checked(); + PushbulletConfig.Token = $('#txtPushbulletAuthKey', form).val(); + PushbulletConfig.DeviceId = $('#txtPushbulletDeviceId', form).val(); ApiClient.updatePluginConfiguration(pluginId, config).then(Dashboard.processPluginConfigurationUpdateResult); }); diff --git a/Pushbullet/Notifier.cs b/Pushbullet/Notifier.cs index ff7188d..886362d 100644 --- a/Pushbullet/Notifier.cs +++ b/Pushbullet/Notifier.cs @@ -30,7 +30,7 @@ public bool IsEnabledForUser(User user) return options != null && IsValid(options) && options.Enabled; } - private PushBulletOptions GetOptions(User user) + private PushbulletOptions GetOptions(User user) { return Plugin.Instance.Configuration.Options .FirstOrDefault(i => string.Equals(i.MediaBrowserUserId, user.Id.ToString("N"), StringComparison.OrdinalIgnoreCase)); @@ -53,7 +53,7 @@ public async Task SendNotification(UserNotification request, CancellationToken c {"body", request.Description} }; - _logger.LogDebug("PushBullet to Token : {0} - {1} - {2}", options.Token, options.DeviceId, request.Description); + _logger.LogDebug("Pushbullet to Token : {0} - {1} - {2}", options.Token, options.DeviceId, request.Description); var _httpRequest = new HttpRequestOptions(); string authInfo = options.Token; authInfo = Convert.ToBase64String(Encoding.UTF8.GetBytes(authInfo)); @@ -70,7 +70,7 @@ public async Task SendNotification(UserNotification request, CancellationToken c } } - private bool IsValid(PushBulletOptions options) + private bool IsValid(PushbulletOptions options) { return !string.IsNullOrEmpty(options.Token); } diff --git a/Pushbullet/Plugin.cs b/Pushbullet/Plugin.cs index 05a1565..6cbafc8 100644 --- a/Pushbullet/Plugin.cs +++ b/Pushbullet/Plugin.cs @@ -20,7 +20,7 @@ public Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer) public override string Name { - get { return "PushBullet Notifications"; } + get { return "Pushbullet Notifications"; } } public IEnumerable GetPages() @@ -39,7 +39,7 @@ public override string Description { get { - return "Sends notifications via PushBullet Service."; + return "Sends notifications via Pushbullet Service."; } } From e5ca8f942b42994649b742a135a1fb66d6c6ce59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20F=C3=A4th?= Date: Thu, 9 May 2019 17:08:55 +0200 Subject: [PATCH 11/11] Create build.yaml --- build.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 build.yaml diff --git a/build.yaml b/build.yaml new file mode 100644 index 0000000..3a6f5f7 --- /dev/null +++ b/build.yaml @@ -0,0 +1,16 @@ +--- +name: "jellyfin-plugin-pushbullet" +guid: "de228f12-e43e-4bd9-9fc0-2830819c3b92" +version: "1" # Please increment with each pull request +jellyfin_version: "10.3.0" # The earliest binary-compatible version +nicename: "Pushbullet" +description: "Jellyfin Pushbullet notification plugin" +overview: > + Get notifications via Pushbullet. +category: "Notifications" +owner: "jellyfin" +artifacts: + - "Pushbullet.dll" +build_type: "dotnet" +dotnet_configuration: "Release" +dotnet_framework: "netstandard2.0"