diff --git a/Kyoo/Controllers/Transcoder/TranscoderAPI.cs b/Kyoo/Controllers/Transcoder/TranscoderAPI.cs index 3f1bcd3b..b82ad9a3 100644 --- a/Kyoo/Controllers/Transcoder/TranscoderAPI.cs +++ b/Kyoo/Controllers/Transcoder/TranscoderAPI.cs @@ -41,7 +41,7 @@ namespace Kyoo.Controllers.TranscoderLink for (int i = 0; i < arrayLength; i++) { Stream stream = Marshal.PtrToStructure(streamsPtr); - if (stream!.Type != StreamType.Unknow && stream.Type != StreamType.Font) + if (stream!.Type != StreamType.Unknow) { tracks[j] = new Track(stream); j++; diff --git a/Kyoo/Tasks/Crawler.cs b/Kyoo/Tasks/Crawler.cs index 596f8f2a..36d89c11 100644 --- a/Kyoo/Tasks/Crawler.cs +++ b/Kyoo/Tasks/Crawler.cs @@ -8,6 +8,7 @@ using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; using Kyoo.Models.Exceptions; +using Kyoo.Models.Watch; using Microsoft.Extensions.DependencyInjection; namespace Kyoo.Controllers @@ -306,7 +307,9 @@ namespace Kyoo.Controllers private async Task> GetTracks(Episode episode) { - episode.Tracks = await _transcoder.ExtractInfos(episode.Path); + episode.Tracks = (await _transcoder.ExtractInfos(episode.Path)) + .Where(x => x.Type != StreamType.Font) + .ToArray(); return episode.Tracks; } diff --git a/Kyoo/Views/API/ShowApi.cs b/Kyoo/Views/API/ShowApi.cs index c64accec..9e49fd54 100644 --- a/Kyoo/Views/API/ShowApi.cs +++ b/Kyoo/Views/API/ShowApi.cs @@ -422,14 +422,18 @@ namespace Kyoo.Api string path = (await _libraryManager.GetShow(slug))?.Path; if (path == null) return NotFound(); + path = Path.Combine(path, "Subtitles", "fonts"); + if (!Directory.Exists(path)) + return new Dictionary(); return Directory.GetFiles(path) - .ToDictionary(Path.GetFileNameWithoutExtension, x => $"{BaseURL}/shows/{slug}/fonts/{x}"); + .ToDictionary(Path.GetFileNameWithoutExtension, + x => $"{BaseURL}/api/shows/{slug}/fonts/{Path.GetFileName(x)}"); } [HttpGet("{showSlug}/font/{slug}")] [HttpGet("{showSlug}/fonts/{slug}")] [Authorize(Policy = "Read")] - public async Task>> GetFont(string showSlug, string slug) + public async Task GetFont(string showSlug, string slug) { string path = (await _libraryManager.GetShow(showSlug))?.Path; if (path == null) diff --git a/Kyoo/Views/WebClient b/Kyoo/Views/WebClient index 83d20f5e..df491983 160000 --- a/Kyoo/Views/WebClient +++ b/Kyoo/Views/WebClient @@ -1 +1 @@ -Subproject commit 83d20f5ebca1ce7cc5ccc987fbcc81e3459a7e53 +Subproject commit df4919833fdd5ecd6c3d0eed09d30fae2a4cf965 diff --git a/transcoder b/transcoder index 00b52325..542241fe 160000 --- a/transcoder +++ b/transcoder @@ -1 +1 @@ -Subproject commit 00b52325c5bda97f03fcb8e33caf9fef239c6c2c +Subproject commit 542241feb932113ea6481f4e49823872fca4f30a