add multi-episode shuffle playout order (#987)
This commit is contained in:
@@ -28,6 +28,12 @@ public class ResourceExtractorService : IHostedService
|
||||
"_default.ass.sbntxt",
|
||||
FileSystemLayout.MusicVideoCreditsTemplatesFolder,
|
||||
cancellationToken);
|
||||
|
||||
await ExtractScriptResource(
|
||||
assembly,
|
||||
"_threePartEpisodes.lua",
|
||||
FileSystemLayout.MultiEpisodeShuffleTemplatesFolder,
|
||||
cancellationToken);
|
||||
}
|
||||
|
||||
public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask;
|
||||
@@ -71,4 +77,18 @@ public class ResourceExtractorService : IHostedService
|
||||
await resource.CopyToAsync(fs, cancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
private static async Task ExtractScriptResource(
|
||||
Assembly assembly,
|
||||
string name,
|
||||
string targetFolder,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
await using Stream resource = assembly.GetManifestResourceStream($"ErsatzTV.Resources.Scripts.{name}");
|
||||
if (resource != null)
|
||||
{
|
||||
await using FileStream fs = File.Create(Path.Combine(targetFolder, name));
|
||||
await resource.CopyToAsync(fs, cancellationToken);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user