Exemple #1
0
        public override void OnDownload(DownloadMessage message)
        {
            var episodeFile = message.EpisodeFile;

            var payload = new WebhookImportPayload
            {
                EventType      = WebhookEventType.Download,
                Series         = new WebhookSeries(message.Series),
                Episodes       = episodeFile.Episodes.Value.ConvertAll(x => new WebhookEpisode(x)),
                EpisodeFile    = new WebhookEpisodeFile(episodeFile),
                IsUpgrade      = message.OldFiles.Any(),
                DownloadClient = message.DownloadClient,
                DownloadId     = message.DownloadId
            };

            if (message.OldFiles.Any())
            {
                payload.DeletedFiles = message.OldFiles.ConvertAll(x => new WebhookEpisodeFile(x)
                {
                    Path = Path.Combine(message.Series.Path,
                                        x.RelativePath)
                }
                                                                   );
            }

            _proxy.SendWebhook(payload, Settings);
        }
Exemple #2
0
        public override void OnDownload(DownloadMessage message)
        {
            var movieFile = message.MovieFile;

            var payload = new WebhookImportPayload
            {
                EventType          = WebhookEventType.Download,
                Movie              = new WebhookMovie(message.Movie),
                RemoteMovie        = new WebhookRemoteMovie(message.Movie),
                MovieFile          = new WebhookMovieFile(movieFile),
                IsUpgrade          = message.OldMovieFiles.Any(),
                DownloadClient     = message.DownloadClientInfo?.Name,
                DownloadClientType = message.DownloadClientInfo?.Type,
                DownloadId         = message.DownloadId
            };

            if (message.OldMovieFiles.Any())
            {
                payload.DeletedFiles = message.OldMovieFiles.ConvertAll(x =>
                                                                        new WebhookMovieFile(x)
                {
                    Path = Path.Combine(message.Movie.Path, x.RelativePath)
                });
            }

            _proxy.SendWebhook(payload, Settings);
        }
Exemple #3
0
        public override void OnReleaseImport(BookDownloadMessage message)
        {
            var bookFiles = message.BookFiles;

            var payload = new WebhookImportPayload
            {
                EventType = "Download",
                Author    = new WebhookAuthor(message.Author),
                Book      = new WebhookBook(message.Book),
                BookFiles = bookFiles.ConvertAll(x => new WebhookBookFile(x)),
                IsUpgrade = message.OldFiles.Any()
            };

            _proxy.SendWebhook(payload, Settings);
        }
Exemple #4
0
        public override void OnDownload(DownloadMessage message)
        {
            var movieFile = message.MovieFile;

            var payload = new WebhookImportPayload
            {
                EventType   = "Download",
                Movie       = new WebhookMovie(message.Movie),
                RemoteMovie = new WebhookRemoteMovie(message.Movie),
                MovieFile   = new WebhookMovieFile(movieFile),
                IsUpgrade   = message.OldMovieFiles.Any()
            };

            _proxy.SendWebhook(payload, Settings);
        }
Exemple #5
0
        public override void OnReleaseImport(AlbumDownloadMessage message)
        {
            var trackFiles = message.TrackFiles;

            var payload = new WebhookImportPayload

            {
                EventType = "Download",
                Artist    = new WebhookArtist(message.Artist),
                Tracks    = trackFiles.SelectMany(x => x.Tracks.Value.Select(y => new WebhookTrack(y)
                {
                    // TODO: Stop passing these parameters inside an episode v3
                    Quality        = x.Quality.Quality.Name,
                    QualityVersion = x.Quality.Revision.Version,
                    ReleaseGroup   = x.ReleaseGroup
                })).ToList(),
                TrackFiles = trackFiles.ConvertAll(x => new WebhookTrackFile(x)),
                IsUpgrade  = message.OldFiles.Any()
            };

            _proxy.SendWebhook(payload, Settings);
        }
Exemple #6
0
        public override void OnDownload(DownloadMessage message)
        {
            var episodeFile = message.EpisodeFile;

            var payload = new WebhookImportPayload
            {
                EventType = "Download",
                Series    = new WebhookSeries(message.Series),
                Episodes  = episodeFile.Episodes.Value.ConvertAll(x => new WebhookEpisode(x)
                {
                    // TODO: Stop passing these parameters inside an episode v3
                    Quality        = episodeFile.Quality.Quality.Name,
                    QualityVersion = episodeFile.Quality.Revision.Version,
                    ReleaseGroup   = episodeFile.ReleaseGroup,
                    SceneName      = episodeFile.SceneName
                }),
                EpisodeFile = new WebhookEpisodeFile(episodeFile),
                IsUpgrade   = message.OldFiles.Any()
            };

            _proxy.SendWebhook(payload, Settings);
        }