Refactored DB to be Series->Volumes->Chapters instead. All functionality that previously worked still works. Cleanup still needed.

This commit is contained in:
Joseph Milazzo 2021-02-01 09:29:11 -06:00
parent a42e54a078
commit 53e85317f9
33 changed files with 2084 additions and 142 deletions

View file

@ -47,6 +47,11 @@ namespace API.Controllers
return Ok(result);
}
/// <summary>
/// Returns All volumes for a series with progress information and Chapters
/// </summary>
/// <param name="seriesId"></param>
/// <returns></returns>
[HttpGet("volumes")]
public async Task<ActionResult<IEnumerable<VolumeDto>>> GetVolumes(int seriesId)
{
@ -61,13 +66,12 @@ namespace API.Controllers
return Ok(await _unitOfWork.SeriesRepository.GetVolumeDtoAsync(volumeId, user.Id));
}
// [HttpGet("volume-files")]
// public async Task<ActionResult<IEnumerable<MangaFileDto>>> GetMangaFiles(int volumeId)
// {
// var user = await _unitOfWork.UserRepository.GetUserByUsernameAsync(User.GetUsername());
// return Ok(await _unitOfWork.SeriesRepository.GetVolumeMangaFileDtos(volumeId));
// }
[HttpGet("chapter")]
public async Task<ActionResult<VolumeDto>> GetChapter(int chapterId)
{
return Ok(await _unitOfWork.VolumeRepository.GetChapterDtoAsync(chapterId));
}
[Authorize(Policy = "RequireAdminRole")]
[HttpPost("scan")]
public ActionResult Scan(int libraryId, int seriesId)