mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-27 04:21:27 +02:00
Test buttons for XBMC
New: Added buttons to test XBMC configuration
This commit is contained in:
@@ -18,11 +18,13 @@ namespace NzbDrone.Web.Controllers
|
||||
private readonly GrowlProvider _growlProvider;
|
||||
private readonly SeasonProvider _seasonProvider;
|
||||
private readonly ProwlProvider _prowlProvider;
|
||||
private readonly XbmcProvider _xbmcProvider;
|
||||
|
||||
public CommandController(JobProvider jobProvider, SabProvider sabProvider,
|
||||
SmtpProvider smtpProvider, TwitterProvider twitterProvider,
|
||||
EpisodeProvider episodeProvider, GrowlProvider growlProvider,
|
||||
SeasonProvider seasonProvider, ProwlProvider prowlProvider)
|
||||
SeasonProvider seasonProvider, ProwlProvider prowlProvider,
|
||||
XbmcProvider xbmcProvider)
|
||||
{
|
||||
_jobProvider = jobProvider;
|
||||
_sabProvider = sabProvider;
|
||||
@@ -32,6 +34,7 @@ namespace NzbDrone.Web.Controllers
|
||||
_growlProvider = growlProvider;
|
||||
_seasonProvider = seasonProvider;
|
||||
_prowlProvider = prowlProvider;
|
||||
_xbmcProvider = xbmcProvider;
|
||||
}
|
||||
|
||||
public JsonResult RssSync()
|
||||
@@ -164,5 +167,33 @@ namespace NzbDrone.Web.Controllers
|
||||
|
||||
return JsonNotificationResult.Info("Success!", "SABnzbd settings have been verified successfully! Version: " + version);
|
||||
}
|
||||
|
||||
public JsonResult TestXbmcNotification(string hosts)
|
||||
{
|
||||
try
|
||||
{
|
||||
_xbmcProvider.TestNotification(hosts);
|
||||
return JsonNotificationResult.Info("Success!", "Test Notification Sent Successfully");
|
||||
}
|
||||
catch(Exception)
|
||||
{
|
||||
}
|
||||
|
||||
return JsonNotificationResult.Oops("Failed to send test notification, please review your settings.");
|
||||
}
|
||||
|
||||
public JsonResult TestXbmcJsonApi(string hosts, string username, string password)
|
||||
{
|
||||
try
|
||||
{
|
||||
_xbmcProvider.TestJsonApi(hosts, username, password);
|
||||
return JsonNotificationResult.Info("Success!", "Successfully tested JSON API");
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
|
||||
return JsonNotificationResult.Oops("Failed to test JSON API, please review your settings.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user