You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
941 B
31 lines
941 B
using System.Collections.Generic;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using NzbDrone.Core.MediaFiles;
|
|
using Sonarr.Http;
|
|
|
|
namespace Sonarr.Api.V3.Episodes
|
|
{
|
|
[V3ApiController("rename")]
|
|
public class RenameEpisodeController : Controller
|
|
{
|
|
private readonly IRenameEpisodeFileService _renameEpisodeFileService;
|
|
|
|
public RenameEpisodeController(IRenameEpisodeFileService renameEpisodeFileService)
|
|
{
|
|
_renameEpisodeFileService = renameEpisodeFileService;
|
|
}
|
|
|
|
[HttpGet]
|
|
[Produces("application/json")]
|
|
public List<RenameEpisodeResource> GetEpisodes(int seriesId, int? seasonNumber)
|
|
{
|
|
if (seasonNumber.HasValue)
|
|
{
|
|
return _renameEpisodeFileService.GetRenamePreviews(seriesId, seasonNumber.Value).ToResource();
|
|
}
|
|
|
|
return _renameEpisodeFileService.GetRenamePreviews(seriesId).ToResource();
|
|
}
|
|
}
|
|
}
|