Kyoo/Kyoo/HtmlAPI/CollectionController.cs
2020-01-17 00:45:35 +01:00

30 lines
775 B
C#

using Kyoo.InternalAPI;
using Kyoo.Models;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
namespace Kyoo.Controllers
{
[Route("api/[controller]")]
[ApiController]
public class CollectionController : ControllerBase
{
private readonly ILibraryManager libraryManager;
public CollectionController(ILibraryManager libraryManager)
{
this.libraryManager = libraryManager;
}
[HttpGet("{collectionSlug}")]
public ActionResult<Collection> GetShows(string collectionSlug)
{
Collection collection = libraryManager.GetCollection(collectionSlug);
if (collection == null)
return NotFound();
return collection;
}
}
}