mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Subtitle fix for track type
This commit is contained in:
parent
9d6efebcf2
commit
c2cad382ba
@ -5,6 +5,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Kyoo.Controllers;
|
||||
using Kyoo.Models.Watch;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
|
||||
namespace Kyoo.Api
|
||||
@ -22,6 +23,8 @@ namespace Kyoo.Api
|
||||
// _transcoder = transcoder;
|
||||
}
|
||||
|
||||
//TODO Create a real route for movie's subtitles.
|
||||
|
||||
[HttpGet("{showSlug}-s{seasonNumber:int}e{episodeNumber:int}.{identifier}.{extension?}")]
|
||||
[Authorize(Policy="Play")]
|
||||
public async Task<IActionResult> GetSubtitle(string showSlug,
|
||||
@ -36,7 +39,7 @@ namespace Kyoo.Api
|
||||
|
||||
if (languageTag != null)
|
||||
subtitle = (await _libraryManager.GetEpisode(showSlug, seasonNumber, episodeNumber))?.Tracks
|
||||
.FirstOrDefault(x => x.Language == languageTag && x.IsForced == forced);
|
||||
.FirstOrDefault(x => x.Type == StreamType.Subtitle && x.Language == languageTag && x.IsForced == forced);
|
||||
|
||||
if (subtitle == null)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user