Browse Source

fix stream_seek type (#988)

* fix stream seek type

* cleanup
pull/989/head
Jason Dove 3 years ago committed by GitHub
parent
commit
88f4d8074a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      ErsatzTV.Core/Interfaces/Scheduling/IMultiEpisodeShuffleCollectionEnumeratorFactory.cs
  2. 10
      ErsatzTV.Core/Scheduling/PlayoutBuilder.cs
  3. 2
      ErsatzTV.Infrastructure/FFmpeg/MusicVideoCreditsGenerator.cs
  4. 4
      ErsatzTV.Infrastructure/Scheduling/MultiEpisodeShuffleCollectionEnumerator.cs
  5. 4
      ErsatzTV.Infrastructure/Scheduling/MultiEpisodeShuffleCollectionEnumeratorFactory.cs

2
ErsatzTV.Core/Interfaces/Scheduling/IMultiEpisodeShuffleCollectionEnumeratorFactory.cs

@ -5,7 +5,7 @@ namespace ErsatzTV.Core.Interfaces.Scheduling; @@ -5,7 +5,7 @@ namespace ErsatzTV.Core.Interfaces.Scheduling;
public interface IMultiEpisodeShuffleCollectionEnumeratorFactory
{
IMediaCollectionEnumerator Create(
string luaTemplatePath,
string luaScriptPath,
IList<MediaItem> mediaItems,
CollectionEnumeratorState state);
}

10
ErsatzTV.Core/Scheduling/PlayoutBuilder.cs

@ -765,18 +765,18 @@ public class PlayoutBuilder : IPlayoutBuilder @@ -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)
{

2
ErsatzTV.Infrastructure/FFmpeg/MusicVideoCreditsGenerator.cs

@ -121,7 +121,7 @@ public class MusicVideoCreditsGenerator : IMusicVideoCreditsGenerator @@ -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);

4
ErsatzTV.Infrastructure/Scheduling/MultiEpisodeShuffleCollectionEnumerator.cs

@ -18,12 +18,12 @@ public class MultiEpisodeShuffleCollectionEnumerator : IMediaCollectionEnumerato @@ -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"];

4
ErsatzTV.Infrastructure/Scheduling/MultiEpisodeShuffleCollectionEnumeratorFactory.cs

@ -16,8 +16,8 @@ public class MultiEpisodeShuffleCollectionEnumeratorFactory @@ -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);
}

Loading…
Cancel
Save