cache data for xmltv (#1228)

* cache channel list for xmltv

* used cached channel data for xmltv

* fixes

* update changelog
This commit is contained in:
Jason Dove
2023-04-03 23:09:54 -05:00
committed by GitHub
parent c9141b0d86
commit 9f42333465
18 changed files with 813 additions and 528 deletions
+5
View File
@@ -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();
+7
View File
@@ -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,