Refactored volume to contain pages and removed /reader/info API endpoint.
This commit is contained in:
parent
c2b41b774a
commit
28ce2bbba1
9 changed files with 571 additions and 18 deletions
|
@ -1,7 +1,5 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using API.Comparators;
|
||||
using API.DTOs;
|
||||
using API.Entities;
|
||||
using API.Interfaces;
|
||||
|
@ -20,20 +18,6 @@ namespace API.Controllers
|
|||
_cacheService = cacheService;
|
||||
}
|
||||
|
||||
[HttpGet("info")]
|
||||
public async Task<ActionResult<int>> GetInformation(int volumeId)
|
||||
{
|
||||
Volume volume = await _cacheService.Ensure(volumeId);
|
||||
|
||||
if (volume == null || !volume.Files.Any())
|
||||
{
|
||||
// TODO: Move this into Ensure and return negative numbers for different error codes.
|
||||
return BadRequest("There are no files in the volume to read.");
|
||||
}
|
||||
|
||||
return Ok(volume.Files.Select(x => x.NumberOfPages).Sum());
|
||||
}
|
||||
|
||||
[HttpGet("image")]
|
||||
public async Task<ActionResult<ImageDto>> GetImage(int volumeId, int page)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue