mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 05:23:31 -07:00
Series Details started
This commit is contained in:
parent
e1a3637107
commit
bb27995eaf
20 changed files with 243 additions and 24 deletions
29
NzbDrone.Api/Episodes/EpisodeModule.cs
Normal file
29
NzbDrone.Api/Episodes/EpisodeModule.cs
Normal file
|
@ -0,0 +1,29 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using AutoMapper;
|
||||
using Nancy;
|
||||
using NzbDrone.Api.Extensions;
|
||||
using NzbDrone.Core.Tv;
|
||||
|
||||
namespace NzbDrone.Api.Episodes
|
||||
{
|
||||
public class EpisodeModule : NzbDroneApiModule
|
||||
{
|
||||
private readonly EpisodeService _episodeService;
|
||||
|
||||
public EpisodeModule(EpisodeService episodeService)
|
||||
: base("/episodes")
|
||||
{
|
||||
_episodeService = episodeService;
|
||||
Get["/{seriesId}"] = x => GetEpisodesForSeries(x.SeriesId);
|
||||
}
|
||||
|
||||
private Response GetEpisodesForSeries(int seriesId)
|
||||
{
|
||||
var episodes = _episodeService.GetEpisodeBySeries(seriesId);
|
||||
return Mapper.Map<List<Episode>, List<EpisodeResource>>(episodes).AsResponse();
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue