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
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user