fix stream_seek type (#988)

* fix stream seek type

* cleanup
This commit is contained in:
Jason Dove
2022-10-09 21:20:34 -05:00
committed by GitHub
parent f5aa2fcac8
commit 88f4d8074a
5 changed files with 11 additions and 11 deletions
@@ -5,7 +5,7 @@ namespace ErsatzTV.Core.Interfaces.Scheduling;
public interface IMultiEpisodeShuffleCollectionEnumeratorFactory
{
IMediaCollectionEnumerator Create(
string luaTemplatePath,
string luaScriptPath,
IList<MediaItem> mediaItems,
CollectionEnumeratorState state);
}
+5 -5
View File
@@ -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"];
@@ -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);
}