Browse Source

fix xmltv generation for on-demand playout mode (#2591)

pull/2592/head
Jason Dove 19 hours ago committed by GitHub
parent
commit
2912e71c10
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      CHANGELOG.md
  2. 2
      ErsatzTV.Application/Playouts/Commands/BuildPlayoutHandler.cs
  3. 11
      ErsatzTV/Services/SchedulerService.cs

2
CHANGELOG.md

@ -10,7 +10,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -10,7 +10,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Add `MediaItem_Resolution` template data (the current `Resolution` variable is the FFmpeg Profile resolution)
- Add `MediaItem_Start` template data (DateTimeOffset)
- Add `MediaItem_Stop` template data (DateTimeOffset)
- Time shift on-demand playouts every hour to prevent XMLTV from appearing empty
### Fixed
- Fix HLS Direct playback with Jellyfin 10.11
@ -23,6 +22,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). @@ -23,6 +22,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Properly set explicit audio decoder on combined audio and video input file
- Fix building sequential schedules across a UTC offset change
- Fix block start time calculation across a UTC offset change
- Fix XMLTV generation for channels using on-demand playout mode
### Changed
- Use smaller batch size for search index updates (100, down from 1000)

2
ErsatzTV.Application/Playouts/Commands/BuildPlayoutHandler.cs

@ -298,7 +298,7 @@ public class BuildPlayoutHandler : IRequestHandler<BuildPlayout, Either<BaseErro @@ -298,7 +298,7 @@ public class BuildPlayoutHandler : IRequestHandler<BuildPlayout, Either<BaseErro
// and therefore the segmenter may need to seek into the next item instead of
// starting at the beginning (if already working ahead)
changeCount += await dbContext.SaveChangesAsync(cancellationToken);
bool hasChanges = changeCount > 0;
bool hasChanges = changeCount > 0 || referenceData.Channel.PlayoutMode is ChannelPlayoutMode.OnDemand;
if (request.Mode != PlayoutBuildMode.Continue && hasChanges)
{

11
ErsatzTV/Services/SchedulerService.cs

@ -213,18 +213,13 @@ public class SchedulerService : BackgroundService @@ -213,18 +213,13 @@ public class SchedulerService : BackgroundService
.Include(p => p.Channel)
.ToListAsync(cancellationToken);
foreach (Playout playout in playouts.OrderBy(p => decimal.Parse(p.Channel.Number, CultureInfo.InvariantCulture)))
foreach (Playout playout in playouts.OrderBy(p => decimal.Parse(
p.Channel.Number,
CultureInfo.InvariantCulture)))
{
await _workerChannel.WriteAsync(
new BuildPlayout(playout.Id, PlayoutBuildMode.Continue),
cancellationToken);
if (playout.Channel.PlayoutMode is ChannelPlayoutMode.OnDemand)
{
await _workerChannel.WriteAsync(
new TimeShiftOnDemandPlayout(playout.Id, DateTimeOffset.Now, false),
cancellationToken);
}
}
}

Loading…
Cancel
Save