mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-28 13:01:28 +02:00
Test buttons for XBMC
New: Added buttons to test XBMC configuration
This commit is contained in:
@@ -31,6 +31,11 @@ namespace NzbDrone.Core.Providers
|
||||
_eventClientProvider = eventClientProvider;
|
||||
}
|
||||
|
||||
public XbmcProvider()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public virtual void Notify(string header, string message)
|
||||
{
|
||||
//Always use EventServer, until Json has real support for it
|
||||
@@ -41,11 +46,6 @@ namespace NzbDrone.Core.Providers
|
||||
}
|
||||
}
|
||||
|
||||
public XbmcProvider()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public virtual void Update(Series series)
|
||||
{
|
||||
//Use Json for Eden/Nightly or depricated HTTP for 10.x (Dharma) to get the proper path
|
||||
@@ -376,6 +376,26 @@ namespace NzbDrone.Core.Providers
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual void TestNotification(string hosts)
|
||||
{
|
||||
foreach (var host in hosts.Split(','))
|
||||
{
|
||||
Logger.Trace("Sending Test Notifcation to XBMC Host: {0}", host);
|
||||
_eventClientProvider.SendNotification("Test Notification", "Success! Notifications are setup correctly", IconType.Jpeg, "NzbDrone.jpg", GetHostWithoutPort(host));
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void TestJsonApi(string hosts, string username, string password)
|
||||
{
|
||||
foreach (var host in hosts.Split(','))
|
||||
{
|
||||
Logger.Trace("Sending Test Notifcation to XBMC Host: {0}", host);
|
||||
var version = GetJsonVersion(host, username, password);
|
||||
if (version == 0)
|
||||
throw new Exception("Failed to get JSON version in test");
|
||||
}
|
||||
}
|
||||
|
||||
private string GetHostWithoutPort(string address)
|
||||
{
|
||||
return address.Split(':')[0];
|
||||
|
Reference in New Issue
Block a user