mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-11-01 19:17:16 -04:00
33 lines
773 B
C#
33 lines
773 B
C#
using Kyoo.Controllers;
|
|
using Kyoo.Models;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
namespace Kyoo.Api
|
|
{
|
|
[Route("api/[controller]")]
|
|
[ApiController]
|
|
public class CollectionController : ControllerBase
|
|
{
|
|
private readonly ILibraryManager _libraryManager;
|
|
|
|
public CollectionController(ILibraryManager libraryManager)
|
|
{
|
|
_libraryManager = libraryManager;
|
|
}
|
|
|
|
[HttpGet("{collectionSlug}")]
|
|
[Authorize(Policy="Read")]
|
|
public async Task<ActionResult<Collection>> GetShows(string collectionSlug)
|
|
{
|
|
Collection collection = await _libraryManager.GetCollection(collectionSlug);
|
|
|
|
if (collection == null)
|
|
return NotFound();
|
|
|
|
return collection;
|
|
}
|
|
}
|
|
} |