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

@@ -33,13 +33,14 @@ namespace NzbDrone.Core.Notifications.Xbmc
const string header = "Radarr - Downloaded";
Notify(Settings, header, message.Message);
UpdateAndClean(message.Series, message.OldFiles.Any());
UpdateAndCleanMovie(message.Movie, message.OldFiles.Any());
}
public override void OnMovieRename(Movie movie)
{
UpdateAndCleanMovie(movie);
}
public override void OnRename(Series series)
{
UpdateAndClean(series);
@@ -92,5 +93,26 @@ namespace NzbDrone.Core.Notifications.Xbmc
_logger.Debug(ex, logMessage);
}
}
private void UpdateAndCleanMovie(Movie movie, bool clean = true)
{
try
{
if (Settings.UpdateLibrary)
{
_xbmcService.UpdateMovie(Settings, movie);
}
if (clean && Settings.CleanLibrary)
{
_xbmcService.Clean(Settings);
}
}
catch (SocketException ex)
{
var logMessage = string.Format("Unable to connect to XBMC Host: {0}:{1}", Settings.Host, Settings.Port);
_logger.Debug(ex, logMessage);
}
}
}
}