diff --git a/Kyoo/Controllers/ThumbnailsManager.cs b/Kyoo/Controllers/ThumbnailsManager.cs index a3de3c0b..2c0a4c5a 100644 --- a/Kyoo/Controllers/ThumbnailsManager.cs +++ b/Kyoo/Controllers/ThumbnailsManager.cs @@ -10,11 +10,11 @@ namespace Kyoo.Controllers { public class ThumbnailsManager : IThumbnailsManager { - private readonly IConfiguration config; + private readonly IConfiguration _config; public ThumbnailsManager(IConfiguration configuration) { - config = configuration; + _config = configuration; } public async Task Validate(Show show) @@ -74,7 +74,7 @@ namespace Kyoo.Controllers return null; foreach (People peop in people) { - string root = config.GetValue("peoplePath"); + string root = _config.GetValue("peoplePath"); Directory.CreateDirectory(root); string localThumb = root + "/" + peop.Slug + ".jpg"; diff --git a/Kyoo/Controllers/Transcoder/Transcoder.cs b/Kyoo/Controllers/Transcoder/Transcoder.cs index 47811e4f..578d2e52 100644 --- a/Kyoo/Controllers/Transcoder/Transcoder.cs +++ b/Kyoo/Controllers/Transcoder/Transcoder.cs @@ -11,17 +11,20 @@ using Kyoo.Controllers.TranscoderLink; namespace Kyoo.Controllers { + public class BadTranscoderException : Exception {} + public class Transcoder : ITranscoder { - private readonly string transmuxPath; - private readonly string transcodePath; + private readonly string _transmuxPath; + private readonly string _transcodePath; public Transcoder(IConfiguration config) { - transmuxPath = config.GetValue("transmuxTempPath"); - transcodePath = config.GetValue("transcodeTempPath"); + _transmuxPath = config.GetValue("transmuxTempPath"); + _transcodePath = config.GetValue("transcodeTempPath"); - Console.WriteLine("&Api INIT (unmanaged stream size): " + TranscoderAPI.init() + ", Stream size: " + Marshal.SizeOf()); + if (TranscoderAPI.init() != Marshal.SizeOf()) + throw new BadTranscoderException(); } public async Task GetTrackInfo(string path) @@ -46,7 +49,7 @@ namespace Kyoo.Controllers public async Task Transmux(WatchItem episode) { - string folder = Path.Combine(transmuxPath, episode.Link); + string folder = Path.Combine(_transmuxPath, episode.Link); string manifest = Path.Combine(folder, episode.Link + ".m3u8"); float playableDuration = 0; bool transmuxFailed = false; @@ -75,7 +78,7 @@ namespace Kyoo.Controllers public async Task Transcode(WatchItem episode) { - string folder = Path.Combine(transcodePath, episode.Link); + string folder = Path.Combine(_transcodePath, episode.Link); string manifest = Path.Combine(folder, episode.Link + ".m3u8"); float playableDuration = 0; bool transmuxFailed = false;