+1
-1
@@ -5,7 +5,7 @@ namespace ErsatzTV.Core.Interfaces.Scheduling;
|
||||
public interface IMultiEpisodeShuffleCollectionEnumeratorFactory
|
||||
{
|
||||
IMediaCollectionEnumerator Create(
|
||||
string luaTemplatePath,
|
||||
string luaScriptPath,
|
||||
IList<MediaItem> mediaItems,
|
||||
CollectionEnumeratorState state);
|
||||
}
|
||||
|
||||
@@ -765,18 +765,18 @@ public class PlayoutBuilder : IPlayoutBuilder
|
||||
{
|
||||
foreach (MetadataGuid guid in show.ShowMetadata.Map(sm => sm.Guids).Flatten())
|
||||
{
|
||||
string luaTemplatePath = Path.ChangeExtension(
|
||||
string luaScriptPath = Path.ChangeExtension(
|
||||
Path.Combine(
|
||||
FileSystemLayout.MultiEpisodeShuffleTemplatesFolder,
|
||||
guid.Guid.Replace("://", "_")),
|
||||
"lua");
|
||||
_logger.LogDebug("Checking for lua template at {Path}", luaTemplatePath);
|
||||
if (_localFileSystem.FileExists(luaTemplatePath))
|
||||
_logger.LogDebug("Checking for lua script at {Path}", luaScriptPath);
|
||||
if (_localFileSystem.FileExists(luaScriptPath))
|
||||
{
|
||||
_logger.LogDebug("Found lua template at {Path}", luaTemplatePath);
|
||||
_logger.LogDebug("Found lua script at {Path}", luaScriptPath);
|
||||
try
|
||||
{
|
||||
return _multiEpisodeFactory.Create(luaTemplatePath, mediaItems, state);
|
||||
return _multiEpisodeFactory.Create(luaScriptPath, mediaItems, state);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
@@ -121,7 +121,7 @@ public class MusicVideoCreditsGenerator : IMusicVideoCreditsGenerator
|
||||
AllArtists = (metadata.Artists ?? new List<MusicVideoArtist>()).Map(a => a.Name),
|
||||
Artist = artist,
|
||||
musicVideo.GetHeadVersion().Duration,
|
||||
settings.StreamSeek
|
||||
StreamSeek = await settings.StreamSeek.IfNoneAsync(TimeSpan.Zero)
|
||||
});
|
||||
|
||||
string fileName = _tempFilePool.GetNextTempFile(TempFileCategory.Subtitle);
|
||||
|
||||
@@ -18,12 +18,12 @@ public class MultiEpisodeShuffleCollectionEnumerator : IMediaCollectionEnumerato
|
||||
public MultiEpisodeShuffleCollectionEnumerator(
|
||||
IList<MediaItem> mediaItems,
|
||||
CollectionEnumeratorState state,
|
||||
string templateFile,
|
||||
string scriptFile,
|
||||
ILogger logger)
|
||||
{
|
||||
_logger = logger;
|
||||
using var lua = new Lua();
|
||||
lua.DoFile(templateFile);
|
||||
lua.DoFile(scriptFile);
|
||||
|
||||
var numGroups = (int)(double)lua["numParts"];
|
||||
|
||||
|
||||
+2
-2
@@ -16,8 +16,8 @@ public class MultiEpisodeShuffleCollectionEnumeratorFactory
|
||||
}
|
||||
|
||||
public IMediaCollectionEnumerator Create(
|
||||
string luaTemplatePath,
|
||||
string luaScriptPath,
|
||||
IList<MediaItem> mediaItems,
|
||||
CollectionEnumeratorState state) =>
|
||||
new MultiEpisodeShuffleCollectionEnumerator(mediaItems, state, luaTemplatePath, _logger);
|
||||
new MultiEpisodeShuffleCollectionEnumerator(mediaItems, state, luaScriptPath, _logger);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user