Exemplo n.º 1
0
        public async Task <GetSingleSeriesResponse> Handle(GetSingleSeriesRequest request, CancellationToken cancellationToken)
        {
            var model = new GetSingleSeriesResponse();

            model.TvShow = await _sonarrClient.GetResponseSingle <Series>($"api/series/{request.Id}");

            return(model);
        }
Exemplo n.º 2
0
        public async Task <GetSingleEpisodeResponse> Handle(GetSingleEpisodeRequest request, CancellationToken cancellationToken)
        {
            var model = new GetSingleEpisodeResponse();

            model.Episode = await _sonarrClient.GetResponseSingle <Episode>($"api/series?apikey={_apiKeys.Sonarr}&id={request.Id}");

            return(model);
        }
Exemplo n.º 3
0
        public async Task <GetLatestEpisodeResponse> Handle(GetLatestEpisodeRequest request, CancellationToken cancellationToken)
        {
            var response = await _sonarrClient.GetResponseSingle <History>($"api/history?pageSize=${request.PageSize}&sortKey=date&sortDir=${request.Order}");

            return(new GetLatestEpisodeResponse()
            {
                History = response
            });
        }