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.
Readarr/src/Readarr.Api.V1/Books/RenameBookController.cs

30 lines
851 B

using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc;
using NzbDrone.Core.MediaFiles;
using Readarr.Http;
namespace Readarr.Api.V1.Books
{
[V1ApiController("rename")]
public class RenameBookController : Controller
{
private readonly IRenameBookFileService _renameBookFileService;
public RenameBookController(IRenameBookFileService renameBookFileService)
{
_renameBookFileService = renameBookFileService;
}
[HttpGet]
public List<RenameBookResource> GetBookFiles(int authorId, int? bookId)
{
if (bookId.HasValue)
{
return _renameBookFileService.GetRenamePreviews(authorId, bookId.Value).ToResource();
}
return _renameBookFileService.GetRenamePreviews(authorId).ToResource();
}
}
}