cache data for xmltv (#1228)
* cache channel list for xmltv * used cached channel data for xmltv * fixes * update changelog
This commit is contained in:
@@ -9,6 +9,7 @@ using ErsatzTV.Core.Errors;
|
||||
using ErsatzTV.Core.FFmpeg;
|
||||
using ErsatzTV.Core.Interfaces.FFmpeg;
|
||||
using ErsatzTV.Core.Iptv;
|
||||
using ErsatzTV.Extensions;
|
||||
using ErsatzTV.Filters;
|
||||
using MediatR;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
@@ -55,7 +56,7 @@ public class IptvController : ControllerBase
|
||||
Request.Host.ToString(),
|
||||
Request.PathBase,
|
||||
Request.Query["access_token"]))
|
||||
.Map<ChannelGuide, IActionResult>(Ok);
|
||||
.ToActionResult();
|
||||
|
||||
[HttpGet("iptv/hdhr/channel/{channelNumber}.ts")]
|
||||
public Task<IActionResult> GetHDHRVideo(string channelNumber, [FromQuery] string mode = "ts")
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Threading.Channels;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Application;
|
||||
using ErsatzTV.Application.Channels;
|
||||
using ErsatzTV.Application.Emby;
|
||||
using ErsatzTV.Application.Jellyfin;
|
||||
using ErsatzTV.Application.Maintenance;
|
||||
@@ -91,6 +92,7 @@ public class SchedulerService : BackgroundService
|
||||
try
|
||||
{
|
||||
await DeleteOrphanedArtwork(cancellationToken);
|
||||
await RefreshChannelGuideChannelList(cancellationToken);
|
||||
await BuildPlayouts(cancellationToken);
|
||||
#if !DEBUG_NO_SYNC
|
||||
await ScanLocalMediaSources(cancellationToken);
|
||||
@@ -185,6 +187,9 @@ public class SchedulerService : BackgroundService
|
||||
}
|
||||
}
|
||||
|
||||
private ValueTask RefreshChannelGuideChannelList(CancellationToken cancellationToken) =>
|
||||
_workerChannel.WriteAsync(new RefreshChannelList(), cancellationToken);
|
||||
|
||||
private async Task ScanLocalMediaSources(CancellationToken cancellationToken)
|
||||
{
|
||||
using IServiceScope scope = _serviceScopeFactory.CreateScope();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Threading.Channels;
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Application;
|
||||
using ErsatzTV.Application.Channels;
|
||||
using ErsatzTV.Application.Maintenance;
|
||||
using ErsatzTV.Application.MediaCollections;
|
||||
using ErsatzTV.Application.Playouts;
|
||||
@@ -47,6 +48,12 @@ public class WorkerService : BackgroundService
|
||||
|
||||
switch (request)
|
||||
{
|
||||
case RefreshChannelList refreshChannelList:
|
||||
await mediator.Send(refreshChannelList, cancellationToken);
|
||||
break;
|
||||
case RefreshChannelData refreshChannelData:
|
||||
await mediator.Send(refreshChannelData, cancellationToken);
|
||||
break;
|
||||
case BuildPlayout buildPlayout:
|
||||
Either<BaseError, Unit> buildPlayoutResult = await mediator.Send(
|
||||
buildPlayout,
|
||||
|
||||
Reference in New Issue
Block a user