mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-27 20:44:00 +02:00
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:

committed by
Leonardo Galli

parent
487c5e22ce
commit
00541e6cc1
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user