New: Support On Delete Notifications for Emby

This commit is contained in:
Robin Dadswell 2021-11-01 21:46:12 +00:00
parent 6a8f6dc5f7
commit e7ff13085e
2 changed files with 30 additions and 1 deletions

View File

@ -55,6 +55,35 @@ namespace NzbDrone.Core.Notifications.Emby
}
}
public override void OnMovieDelete(MovieDeleteMessage deleteMessage)
{
if (deleteMessage.DeletedFiles)
{
if (Settings.Notify)
{
_mediaBrowserService.Notify(Settings, MOVIE_DELETED_TITLE_BRANDED, deleteMessage.Message);
}
if (Settings.UpdateLibrary)
{
_mediaBrowserService.UpdateMovies(Settings, deleteMessage.Movie, "Deleted");
}
}
}
public override void OnMovieFileDelete(MovieFileDeleteMessage deleteMessage)
{
if (Settings.Notify)
{
_mediaBrowserService.Notify(Settings, MOVIE_FILE_DELETED_TITLE_BRANDED, deleteMessage.Message);
}
if (Settings.UpdateLibrary)
{
_mediaBrowserService.UpdateMovies(Settings, deleteMessage.Movie, "Deleted");
}
}
public override ValidationResult Test()
{
var failures = new List<ValidationFailure>();

View File

@ -39,7 +39,7 @@ namespace NzbDrone.Core.Notifications.Emby
[FieldDefinition(4, Label = "Send Notifications", HelpText = "Have MediaBrowser send notfications to configured providers", Type = FieldType.Checkbox)]
public bool Notify { get; set; }
[FieldDefinition(5, Label = "Update Library", HelpText = "Update Library on Import & Rename?", Type = FieldType.Checkbox)]
[FieldDefinition(5, Label = "Update Library", HelpText = "Update Library on Import, Rename or Delete?", Type = FieldType.Checkbox)]
public bool UpdateLibrary { get; set; }
[JsonIgnore]