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;
public interface IMultiEpisodeShuffleCollectionEnumeratorFactory public interface IMultiEpisodeShuffleCollectionEnumeratorFactory
{ {
IMediaCollectionEnumerator Create( IMediaCollectionEnumerator Create(
string luaTemplatePath, string luaScriptPath,
IList<MediaItem> mediaItems, IList<MediaItem> mediaItems,
CollectionEnumeratorState state); CollectionEnumeratorState state);
} }

10
ErsatzTV.Core/Scheduling/PlayoutBuilder.cs

@ -765,18 +765,18 @@ public class PlayoutBuilder : IPlayoutBuilder
{ {
foreach (MetadataGuid guid in show.ShowMetadata.Map(sm => sm.Guids).Flatten()) foreach (MetadataGuid guid in show.ShowMetadata.Map(sm => sm.Guids).Flatten())
{ {
string luaTemplatePath = Path.ChangeExtension( string luaScriptPath = Path.ChangeExtension(
Path.Combine( Path.Combine(
FileSystemLayout.MultiEpisodeShuffleTemplatesFolder, FileSystemLayout.MultiEpisodeShuffleTemplatesFolder,
guid.Guid.Replace("://", "_")), guid.Guid.Replace("://", "_")),
"lua"); "lua");
_logger.LogDebug("Checking for lua template at {Path}", luaTemplatePath); _logger.LogDebug("Checking for lua script at {Path}", luaScriptPath);
if (_localFileSystem.FileExists(luaTemplatePath)) if (_localFileSystem.FileExists(luaScriptPath))
{ {
_logger.LogDebug("Found lua template at {Path}", luaTemplatePath); _logger.LogDebug("Found lua script at {Path}", luaScriptPath);
try try
{ {
return _multiEpisodeFactory.Create(luaTemplatePath, mediaItems, state); return _multiEpisodeFactory.Create(luaScriptPath, mediaItems, state);
} }
catch (Exception ex) catch (Exception ex)
{ {

2
ErsatzTV.Infrastructure/FFmpeg/MusicVideoCreditsGenerator.cs

@ -121,7 +121,7 @@ public class MusicVideoCreditsGenerator : IMusicVideoCreditsGenerator
AllArtists = (metadata.Artists ?? new List<MusicVideoArtist>()).Map(a => a.Name), AllArtists = (metadata.Artists ?? new List<MusicVideoArtist>()).Map(a => a.Name),
Artist = artist, Artist = artist,
musicVideo.GetHeadVersion().Duration, musicVideo.GetHeadVersion().Duration,
settings.StreamSeek StreamSeek = await settings.StreamSeek.IfNoneAsync(TimeSpan.Zero)
}); });
string fileName = _tempFilePool.GetNextTempFile(TempFileCategory.Subtitle); string fileName = _tempFilePool.GetNextTempFile(TempFileCategory.Subtitle);

4
ErsatzTV.Infrastructure/Scheduling/MultiEpisodeShuffleCollectionEnumerator.cs

@ -18,12 +18,12 @@ public class MultiEpisodeShuffleCollectionEnumerator : IMediaCollectionEnumerato
public MultiEpisodeShuffleCollectionEnumerator( public MultiEpisodeShuffleCollectionEnumerator(
IList<MediaItem> mediaItems, IList<MediaItem> mediaItems,
CollectionEnumeratorState state, CollectionEnumeratorState state,
string templateFile, string scriptFile,
ILogger logger) ILogger logger)
{ {
_logger = logger; _logger = logger;
using var lua = new Lua(); using var lua = new Lua();
lua.DoFile(templateFile); lua.DoFile(scriptFile);
var numGroups = (int)(double)lua["numParts"]; var numGroups = (int)(double)lua["numParts"];

4
ErsatzTV.Infrastructure/Scheduling/MultiEpisodeShuffleCollectionEnumeratorFactory.cs

@ -16,8 +16,8 @@ public class MultiEpisodeShuffleCollectionEnumeratorFactory
} }
public IMediaCollectionEnumerator Create( public IMediaCollectionEnumerator Create(
string luaTemplatePath, string luaScriptPath,
IList<MediaItem> mediaItems, IList<MediaItem> mediaItems,
CollectionEnumeratorState state) => CollectionEnumeratorState state) =>
new MultiEpisodeShuffleCollectionEnumerator(mediaItems, state, luaTemplatePath, _logger); new MultiEpisodeShuffleCollectionEnumerator(mediaItems, state, luaScriptPath, _logger);
} }

Loading…
Cancel
Save