More Notification Updates (#482)

* Custom Script: Add Movie_Path

* Add Emby Update Support

* Notifications: Maybe add Kodi / XBMC Update Support
This commit is contained in:
vertigo235
2017-01-27 12:01:18 -06:00
committed by Leonardo Galli
parent 487c5e22ce
commit 00541e6cc1
9 changed files with 143 additions and 5 deletions

View File

@@ -44,7 +44,25 @@ namespace NzbDrone.Core.Notifications.Xbmc
UpdateLibrary(settings, series);
}
public void UpdateMovie(XbmcSettings settings, Movie movie)
{
if (!settings.AlwaysUpdate)
{
_logger.Debug("Determining if there are any active players on XBMC host: {0}", settings.Address);
var activePlayers = _proxy.GetActivePlayers(settings);
if (activePlayers.Any(a => a.Type.Equals("video")))
{
_logger.Debug("Video is currently playing, skipping library update");
return;
}
}
UpdateMovieLibrary(settings, movie);
}
public void Clean(XbmcSettings settings)
{
_proxy.CleanLibrary(settings);
@@ -108,5 +126,23 @@ namespace NzbDrone.Core.Notifications.Xbmc
_logger.Debug(ex, ex.Message);
}
}
private void UpdateMovieLibrary(XbmcSettings settings, Movie movie)
{
try
{
var response = _proxy.UpdateLibrary(settings, null);
if (!response.Equals("OK", StringComparison.InvariantCultureIgnoreCase))
{
_logger.Debug("Failed to update library for: {0}", settings.Address);
}
}
catch (Exception ex)
{
_logger.Debug(ex, ex.Message);
}
}
}
}