コード例 #1
0
        public void Handle(MovieFileDeletedEvent message)
        {
            var deleteMessage = new DeleteMessage();

            deleteMessage.Message   = GetMessage(message.MovieFile.Movie, message.MovieFile.Quality);
            deleteMessage.MovieFile = message.MovieFile;
            deleteMessage.Movie     = message.MovieFile.Movie;
            deleteMessage.Reason    = message.Reason;

            foreach (var notification in _notificationFactory.OnDeleteEnabled())
            {
                try
                {
                    if (ShouldHandleMovie(notification.Definition, message.MovieFile.Movie))
                    {
                        notification.OnDelete(deleteMessage);
                    }
                }
                catch (Exception ex)
                {
                    _logger.Warn(ex, "Unable to send OnDelete notification to: " + notification.Definition.Name);
                }
            }
        }