Browse Source

update dependencies; code cleanup (#1357)

* update dependencies

* code cleanup
pull/1358/head
Jason Dove 3 years ago committed by GitHub
parent
commit
f929dc92d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .config/dotnet-tools.json
  2. 1
      ErsatzTV.Application/Channels/Commands/RefreshChannelListHandler.cs
  3. 5
      ErsatzTV.Application/Playouts/Commands/BuildPlayoutHandler.cs
  4. 4
      ErsatzTV.Application/ProgramSchedules/Commands/ProgramScheduleItemCommandBase.cs
  5. 2
      ErsatzTV.Application/ProgramSchedules/Commands/ReplaceProgramScheduleItemsHandler.cs
  6. 4
      ErsatzTV.Application/Resolutions/Commands/CreateCustomResolutionHandler.cs
  7. 2
      ErsatzTV.Application/Search/Commands/RebuildSearchIndexHandler.cs
  8. 8
      ErsatzTV.Application/Subtitles/Commands/ExtractEmbeddedSubtitlesHandler.cs
  9. 2
      ErsatzTV.Core.Tests/ErsatzTV.Core.Tests.csproj
  10. 10
      ErsatzTV.Core.Tests/Scheduling/PlayoutModeSchedulerBaseTests.cs
  11. 2
      ErsatzTV.Core/Domain/Resolution.cs
  12. 4
      ErsatzTV.Core/FFmpeg/FFmpegLibraryProcessService.cs
  13. 4
      ErsatzTV.Core/Interfaces/Scheduling/IMediaCollectionEnumerator.cs
  14. 6
      ErsatzTV.Core/Scheduling/ChronologicalMediaCollectionEnumerator.cs
  15. 6
      ErsatzTV.Core/Scheduling/CustomOrderCollectionEnumerator.cs
  16. 2
      ErsatzTV.Core/Scheduling/PlayoutModeSchedulerBase.cs
  17. 4
      ErsatzTV.Core/Scheduling/PlayoutModeSchedulerDuration.cs
  18. 2
      ErsatzTV.Core/Scheduling/PlayoutModeSchedulerFlood.cs
  19. 2
      ErsatzTV.Core/Scheduling/PlayoutModeSchedulerMultiple.cs
  20. 2
      ErsatzTV.Core/Scheduling/PlayoutModeSchedulerOne.cs
  21. 6
      ErsatzTV.Core/Scheduling/RandomizedMediaCollectionEnumerator.cs
  22. 6
      ErsatzTV.Core/Scheduling/SeasonEpisodeMediaCollectionEnumerator.cs
  23. 10
      ErsatzTV.Core/Scheduling/ShuffleInOrderCollectionEnumerator.cs
  24. 10
      ErsatzTV.Core/Scheduling/ShuffledMediaCollectionEnumerator.cs
  25. 6
      ErsatzTV.Core/SystemStartup.cs
  26. 2
      ErsatzTV.FFmpeg.Tests/ErsatzTV.FFmpeg.Tests.csproj
  27. 6
      ErsatzTV.FFmpeg/Capabilities/NvidiaHardwareCapabilities.cs
  28. 5
      ErsatzTV.FFmpeg/Capabilities/Vaapi/VaapiProfileEntrypoint.cs
  29. 60
      ErsatzTV.FFmpeg/Capabilities/VaapiHardwareCapabilities.cs
  30. 5
      ErsatzTV.FFmpeg/Filter/ComplexFilter.cs
  31. 3
      ErsatzTV.FFmpeg/Option/Mp4OutputOptions.cs
  32. 2
      ErsatzTV.Infrastructure.Tests/ErsatzTV.Infrastructure.Tests.csproj
  33. 2
      ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj
  34. 10
      ErsatzTV.Infrastructure/Scheduling/MultiEpisodeShuffleCollectionEnumerator.cs
  35. 4
      ErsatzTV.Scanner.Tests/Core/FFmpeg/TranscodingTests.cs
  36. 2
      ErsatzTV.Scanner.Tests/ErsatzTV.Scanner.Tests.csproj
  37. 6
      ErsatzTV/ErsatzTV.csproj
  38. 8
      ErsatzTV/Pages/Index.razor
  39. 8
      ErsatzTV/Pages/Settings.razor
  40. 5
      ErsatzTV/Program.cs
  41. 2
      ErsatzTV/Services/SchedulerService.cs
  42. 5
      ErsatzTV/Shared/AddCustomResolutionDialog.razor
  43. 5
      ErsatzTV/Shared/MainLayout.razor
  44. 3
      ErsatzTV/ViewModels/ProgramScheduleItemEditViewModel.cs

2
.config/dotnet-tools.json

@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"jetbrains.resharper.globaltools": {
"version": "2023.1.3",
"version": "2023.2.0",
"commands": [
"jb"
]

1
ErsatzTV.Application/Channels/Commands/RefreshChannelListHandler.cs

@ -1,4 +1,3 @@ @@ -1,4 +1,3 @@
using System.Data;
using System.Data.Common;
using System.Xml;
using Dapper;

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

@ -19,8 +19,8 @@ public class BuildPlayoutHandler : IRequestHandler<BuildPlayout, Either<BaseErro @@ -19,8 +19,8 @@ public class BuildPlayoutHandler : IRequestHandler<BuildPlayout, Either<BaseErro
{
private readonly IClient _client;
private readonly IDbContextFactory<TvContext> _dbContextFactory;
private readonly IFFmpegSegmenterService _ffmpegSegmenterService;
private readonly IEntityLocker _entityLocker;
private readonly IFFmpegSegmenterService _ffmpegSegmenterService;
private readonly IPlayoutBuilder _playoutBuilder;
private readonly ChannelWriter<IBackgroundServiceRequest> _workerChannel;
@ -112,7 +112,8 @@ public class BuildPlayoutHandler : IRequestHandler<BuildPlayout, Either<BaseErro @@ -112,7 +112,8 @@ public class BuildPlayoutHandler : IRequestHandler<BuildPlayout, Either<BaseErro
private static Validation<BaseError, Playout> DiscardAttemptsMustBeValid(Playout playout)
{
foreach (ProgramScheduleItemDuration item in playout.ProgramSchedule.Items.OfType<ProgramScheduleItemDuration>())
foreach (ProgramScheduleItemDuration item in
playout.ProgramSchedule.Items.OfType<ProgramScheduleItemDuration>())
{
item.DiscardToFillAttempts = item.PlaybackOrder switch
{

4
ErsatzTV.Application/ProgramSchedules/Commands/ProgramScheduleItemCommandBase.cs

@ -253,7 +253,9 @@ public abstract class ProgramScheduleItemCommandBase @@ -253,7 +253,9 @@ public abstract class ProgramScheduleItemCommandBase
PlaybackOrder = item.PlaybackOrder,
PlayoutDuration = FixDuration(item.PlayoutDuration.GetValueOrDefault()),
TailMode = item.TailMode,
DiscardToFillAttempts = FixDiscardToFillAttempts(item.PlaybackOrder, item.DiscardToFillAttempts.GetValueOrDefault()),
DiscardToFillAttempts = FixDiscardToFillAttempts(
item.PlaybackOrder,
item.DiscardToFillAttempts.GetValueOrDefault()),
CustomTitle = item.CustomTitle,
GuideMode = item.GuideMode,
PreRollFillerId = item.PreRollFillerId,

2
ErsatzTV.Application/ProgramSchedules/Commands/ReplaceProgramScheduleItemsHandler.cs

@ -29,7 +29,7 @@ public class ReplaceProgramScheduleItemsHandler : ProgramScheduleItemCommandBase @@ -29,7 +29,7 @@ public class ReplaceProgramScheduleItemsHandler : ProgramScheduleItemCommandBase
{
await using TvContext dbContext = await _dbContextFactory.CreateDbContextAsync(cancellationToken);
Validation<BaseError, ProgramSchedule> validation = await Validate(dbContext, request);
return await validation.Apply(ps => PersistItems(dbContext, request, ps));
return await LanguageExtensions.Apply(validation, ps => PersistItems(dbContext, request, ps));
}
private async Task<IEnumerable<ProgramScheduleItemViewModel>> PersistItems(

4
ErsatzTV.Application/Resolutions/Commands/CreateCustomResolutionHandler.cs

@ -9,10 +9,8 @@ public class CreateCustomResolutionHandler : IRequestHandler<CreateCustomResolut @@ -9,10 +9,8 @@ public class CreateCustomResolutionHandler : IRequestHandler<CreateCustomResolut
{
private readonly IDbContextFactory<TvContext> _dbContextFactory;
public CreateCustomResolutionHandler(IDbContextFactory<TvContext> dbContextFactory)
{
public CreateCustomResolutionHandler(IDbContextFactory<TvContext> dbContextFactory) =>
_dbContextFactory = dbContextFactory;
}
public async Task<Option<BaseError>> Handle(CreateCustomResolution request, CancellationToken cancellationToken)
{

2
ErsatzTV.Application/Search/Commands/RebuildSearchIndexHandler.cs

@ -14,11 +14,11 @@ public class RebuildSearchIndexHandler : IRequestHandler<RebuildSearchIndex> @@ -14,11 +14,11 @@ public class RebuildSearchIndexHandler : IRequestHandler<RebuildSearchIndex>
{
private readonly IConfigElementRepository _configElementRepository;
private readonly IFallbackMetadataProvider _fallbackMetadataProvider;
private readonly SystemStartup _systemStartup;
private readonly ILocalFileSystem _localFileSystem;
private readonly ILogger<RebuildSearchIndexHandler> _logger;
private readonly ISearchIndex _searchIndex;
private readonly ICachingSearchRepository _searchRepository;
private readonly SystemStartup _systemStartup;
public RebuildSearchIndexHandler(
ISearchIndex searchIndex,

8
ErsatzTV.Application/Subtitles/Commands/ExtractEmbeddedSubtitlesHandler.cs

@ -21,8 +21,8 @@ namespace ErsatzTV.Application.Subtitles; @@ -21,8 +21,8 @@ namespace ErsatzTV.Application.Subtitles;
public class ExtractEmbeddedSubtitlesHandler : IRequestHandler<ExtractEmbeddedSubtitles, Either<BaseError, Unit>>
{
private readonly IDbContextFactory<TvContext> _dbContextFactory;
private readonly ILocalFileSystem _localFileSystem;
private readonly IEntityLocker _entityLocker;
private readonly ILocalFileSystem _localFileSystem;
private readonly ILogger<ExtractEmbeddedSubtitlesHandler> _logger;
private readonly ChannelWriter<IBackgroundServiceRequest> _workerChannel;
@ -74,7 +74,8 @@ public class ExtractEmbeddedSubtitlesHandler : IRequestHandler<ExtractEmbeddedSu @@ -74,7 +74,8 @@ public class ExtractEmbeddedSubtitlesHandler : IRequestHandler<ExtractEmbeddedSu
.AsNoTracking()
.Filter(
p => p.Channel.SubtitleMode != ChannelSubtitleMode.None ||
p.ProgramSchedule.Items.Any(psi => psi.SubtitleMode != null && psi.SubtitleMode != ChannelSubtitleMode.None))
p.ProgramSchedule.Items.Any(
psi => psi.SubtitleMode != null && psi.SubtitleMode != ChannelSubtitleMode.None))
.SelectOneAsync(p => p.Id, p => p.Id == request.PlayoutId.IfNone(-1));
playoutIdsToCheck.AddRange(requestedPlayout.Map(p => p.Id));
@ -86,7 +87,8 @@ public class ExtractEmbeddedSubtitlesHandler : IRequestHandler<ExtractEmbeddedSu @@ -86,7 +87,8 @@ public class ExtractEmbeddedSubtitlesHandler : IRequestHandler<ExtractEmbeddedSu
.AsNoTracking()
.Filter(
p => p.Channel.SubtitleMode != ChannelSubtitleMode.None ||
p.ProgramSchedule.Items.Any(psi => psi.SubtitleMode != null && psi.SubtitleMode != ChannelSubtitleMode.None))
p.ProgramSchedule.Items.Any(
psi => psi.SubtitleMode != null && psi.SubtitleMode != ChannelSubtitleMode.None))
.Map(p => p.Id)
.ToList();
}

2
ErsatzTV.Core.Tests/ErsatzTV.Core.Tests.csproj

@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
<PackageReference Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.0" />
<PackageReference Include="Microsoft.VisualStudio.Threading.Analyzers" Version="17.6.40">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

10
ErsatzTV.Core.Tests/Scheduling/PlayoutModeSchedulerBaseTests.cs

@ -58,7 +58,7 @@ public class PlayoutModeSchedulerBaseTests : SchedulerTestBase @@ -58,7 +58,7 @@ public class PlayoutModeSchedulerBaseTests : SchedulerTestBase
scheduleItem,
new PlayoutItem(),
new List<MediaChapter>(),
log: true,
true,
_cancellationToken);
playoutItems.Count.Should().Be(1);
@ -111,7 +111,7 @@ public class PlayoutModeSchedulerBaseTests : SchedulerTestBase @@ -111,7 +111,7 @@ public class PlayoutModeSchedulerBaseTests : SchedulerTestBase
scheduleItem,
new PlayoutItem(),
new List<MediaChapter> { new() },
log: true,
true,
_cancellationToken);
playoutItems.Count.Should().Be(1);
@ -178,7 +178,7 @@ public class PlayoutModeSchedulerBaseTests : SchedulerTestBase @@ -178,7 +178,7 @@ public class PlayoutModeSchedulerBaseTests : SchedulerTestBase
new() { StartTime = TimeSpan.Zero, EndTime = TimeSpan.FromMinutes(6) },
new() { StartTime = TimeSpan.FromMinutes(6), EndTime = TimeSpan.FromMinutes(60) }
},
log: true,
true,
_cancellationToken);
playoutItems.Count.Should().Be(3);
@ -270,7 +270,7 @@ public class PlayoutModeSchedulerBaseTests : SchedulerTestBase @@ -270,7 +270,7 @@ public class PlayoutModeSchedulerBaseTests : SchedulerTestBase
new() { StartTime = TimeSpan.Zero, EndTime = TimeSpan.FromMinutes(6) },
new() { StartTime = TimeSpan.FromMinutes(6), EndTime = TimeSpan.FromMinutes(45) }
},
log: true,
true,
_cancellationToken);
playoutItems.Count.Should().Be(5);
@ -376,7 +376,7 @@ public class PlayoutModeSchedulerBaseTests : SchedulerTestBase @@ -376,7 +376,7 @@ public class PlayoutModeSchedulerBaseTests : SchedulerTestBase
new() { StartTime = TimeSpan.Zero, EndTime = TimeSpan.FromMinutes(6) },
new() { StartTime = TimeSpan.FromMinutes(6), EndTime = TimeSpan.FromMinutes(45) }
},
log: true,
true,
_cancellationToken);
playoutItems.Count.Should().Be(5);

2
ErsatzTV.Core/Domain/Resolution.cs

@ -6,9 +6,9 @@ public class Resolution : IDisplaySize @@ -6,9 +6,9 @@ public class Resolution : IDisplaySize
{
public int Id { get; set; }
public string Name { get; set; }
public bool IsCustom { get; set; }
public int Height { get; set; }
public int Width { get; set; }
public bool IsCustom { get; set; }
public override string ToString() => $"{Width}x{Height}";
}

4
ErsatzTV.Core/FFmpeg/FFmpegLibraryProcessService.cs

@ -16,11 +16,11 @@ namespace ErsatzTV.Core.FFmpeg; @@ -16,11 +16,11 @@ namespace ErsatzTV.Core.FFmpeg;
public class FFmpegLibraryProcessService : IFFmpegProcessService
{
private readonly IConfigElementRepository _configElementRepository;
private readonly FFmpegProcessService _ffmpegProcessService;
private readonly IFFmpegStreamSelector _ffmpegStreamSelector;
private readonly ILogger<FFmpegLibraryProcessService> _logger;
private readonly IPipelineBuilderFactory _pipelineBuilderFactory;
private readonly IConfigElementRepository _configElementRepository;
private readonly FFmpegPlaybackSettingsCalculator _playbackSettingsCalculator;
private readonly ITempFilePool _tempFilePool;
@ -95,7 +95,7 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService @@ -95,7 +95,7 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService
hlsRealtime,
targetFramerate);
var allSubtitles = await getSubtitles(playbackSettings);
List<Subtitle> allSubtitles = await getSubtitles(playbackSettings);
Option<Subtitle> maybeSubtitle =
await _ffmpegStreamSelector.SelectSubtitleStream(

4
ErsatzTV.Core/Interfaces/Scheduling/IMediaCollectionEnumerator.cs

@ -4,10 +4,10 @@ namespace ErsatzTV.Core.Interfaces.Scheduling; @@ -4,10 +4,10 @@ namespace ErsatzTV.Core.Interfaces.Scheduling;
public interface IMediaCollectionEnumerator
{
void ResetState(CollectionEnumeratorState state);
CollectionEnumeratorState State { get; }
Option<MediaItem> Current { get; }
void MoveNext();
int Count { get; }
Option<TimeSpan> MinimumDuration { get; }
void ResetState(CollectionEnumeratorState state);
void MoveNext();
}

6
ErsatzTV.Core/Scheduling/ChronologicalMediaCollectionEnumerator.cs

@ -6,8 +6,8 @@ namespace ErsatzTV.Core.Scheduling; @@ -6,8 +6,8 @@ namespace ErsatzTV.Core.Scheduling;
public sealed class ChronologicalMediaCollectionEnumerator : IMediaCollectionEnumerator
{
private readonly IList<MediaItem> _sortedMediaItems;
private readonly Lazy<Option<TimeSpan>> _lazyMinimumDuration;
private readonly IList<MediaItem> _sortedMediaItems;
public ChronologicalMediaCollectionEnumerator(
IEnumerable<MediaItem> mediaItems,
@ -31,11 +31,9 @@ public sealed class ChronologicalMediaCollectionEnumerator : IMediaCollectionEnu @@ -31,11 +31,9 @@ public sealed class ChronologicalMediaCollectionEnumerator : IMediaCollectionEnu
}
}
public void ResetState(CollectionEnumeratorState state)
{
public void ResetState(CollectionEnumeratorState state) =>
// seed doesn't matter in chronological
State.Index = state.Index;
}
public CollectionEnumeratorState State { get; }

6
ErsatzTV.Core/Scheduling/CustomOrderCollectionEnumerator.cs

@ -7,10 +7,10 @@ namespace ErsatzTV.Core.Scheduling; @@ -7,10 +7,10 @@ namespace ErsatzTV.Core.Scheduling;
public class CustomOrderCollectionEnumerator : IMediaCollectionEnumerator
{
private readonly Collection _collection;
private readonly Lazy<Option<TimeSpan>> _lazyMinimumDuration;
private readonly IList<MediaItem> _mediaItems;
private readonly IList<MediaItem> _sortedMediaItems;
private readonly Lazy<Option<TimeSpan>> _lazyMinimumDuration;
public CustomOrderCollectionEnumerator(
Collection collection,
@ -35,11 +35,9 @@ public class CustomOrderCollectionEnumerator : IMediaCollectionEnumerator @@ -35,11 +35,9 @@ public class CustomOrderCollectionEnumerator : IMediaCollectionEnumerator
}
}
public void ResetState(CollectionEnumeratorState state)
{
public void ResetState(CollectionEnumeratorState state) =>
// seed doesn't matter here
State.Index = state.Index;
}
public CollectionEnumeratorState State { get; }

2
ErsatzTV.Core/Scheduling/PlayoutModeSchedulerBase.cs

@ -4,8 +4,6 @@ using ErsatzTV.Core.Extensions; @@ -4,8 +4,6 @@ using ErsatzTV.Core.Extensions;
using ErsatzTV.Core.Interfaces.Scheduling;
using LanguageExt.UnsafeValueAccess;
using Microsoft.Extensions.Logging;
using Serilog;
using ILogger = Microsoft.Extensions.Logging.ILogger;
namespace ErsatzTV.Core.Scheduling;

4
ErsatzTV.Core/Scheduling/PlayoutModeSchedulerDuration.cs

@ -26,7 +26,7 @@ public class PlayoutModeSchedulerDuration : PlayoutModeSchedulerBase<ProgramSche @@ -26,7 +26,7 @@ public class PlayoutModeSchedulerDuration : PlayoutModeSchedulerBase<ProgramSche
var willFinishInTime = true;
Option<DateTimeOffset> durationUntil = None;
int discardAttempts = 0;
var discardAttempts = 0;
IMediaCollectionEnumerator contentEnumerator =
collectionEnumerators[CollectionKey.ForScheduleItem(scheduleItem)];
@ -134,7 +134,7 @@ public class PlayoutModeSchedulerDuration : PlayoutModeSchedulerBase<ProgramSche @@ -134,7 +134,7 @@ public class PlayoutModeSchedulerDuration : PlayoutModeSchedulerBase<ProgramSche
scheduleItem,
playoutItem,
itemChapters,
log: false,
false,
cancellationToken);
DateTimeOffset itemEndTimeWithFiller = maybePlayoutItems.Max(pi => pi.FinishOffset);

2
ErsatzTV.Core/Scheduling/PlayoutModeSchedulerFlood.cs

@ -86,7 +86,7 @@ public class PlayoutModeSchedulerFlood : PlayoutModeSchedulerBase<ProgramSchedul @@ -86,7 +86,7 @@ public class PlayoutModeSchedulerFlood : PlayoutModeSchedulerBase<ProgramSchedul
scheduleItem,
playoutItem,
itemChapters,
log: false,
false,
cancellationToken);
DateTimeOffset itemEndTimeWithFiller = maybePlayoutItems.Max(pi => pi.FinishOffset);

2
ErsatzTV.Core/Scheduling/PlayoutModeSchedulerMultiple.cs

@ -85,7 +85,7 @@ public class PlayoutModeSchedulerMultiple : PlayoutModeSchedulerBase<ProgramSche @@ -85,7 +85,7 @@ public class PlayoutModeSchedulerMultiple : PlayoutModeSchedulerBase<ProgramSche
scheduleItem,
playoutItem,
itemChapters,
log: true,
true,
cancellationToken));
nextState = nextState with

2
ErsatzTV.Core/Scheduling/PlayoutModeSchedulerOne.cs

@ -59,7 +59,7 @@ public class PlayoutModeSchedulerOne : PlayoutModeSchedulerBase<ProgramScheduleI @@ -59,7 +59,7 @@ public class PlayoutModeSchedulerOne : PlayoutModeSchedulerBase<ProgramScheduleI
scheduleItem,
playoutItem,
itemChapters,
log: true,
true,
cancellationToken);
PlayoutBuilderState nextState = playoutBuilderState with

6
ErsatzTV.Core/Scheduling/RandomizedMediaCollectionEnumerator.cs

@ -6,8 +6,8 @@ namespace ErsatzTV.Core.Scheduling; @@ -6,8 +6,8 @@ namespace ErsatzTV.Core.Scheduling;
public class RandomizedMediaCollectionEnumerator : IMediaCollectionEnumerator
{
private readonly IList<MediaItem> _mediaItems;
private readonly Lazy<Option<TimeSpan>> _lazyMinimumDuration;
private readonly IList<MediaItem> _mediaItems;
private readonly Random _random;
private int _index;
@ -27,11 +27,9 @@ public class RandomizedMediaCollectionEnumerator : IMediaCollectionEnumerator @@ -27,11 +27,9 @@ public class RandomizedMediaCollectionEnumerator : IMediaCollectionEnumerator
}
}
public void ResetState(CollectionEnumeratorState state)
{
public void ResetState(CollectionEnumeratorState state) =>
// seed never changes here, no need to reset
State.Index = state.Index;
}
public CollectionEnumeratorState State { get; }

6
ErsatzTV.Core/Scheduling/SeasonEpisodeMediaCollectionEnumerator.cs

@ -6,8 +6,8 @@ namespace ErsatzTV.Core.Scheduling; @@ -6,8 +6,8 @@ namespace ErsatzTV.Core.Scheduling;
public sealed class SeasonEpisodeMediaCollectionEnumerator : IMediaCollectionEnumerator
{
private readonly IList<MediaItem> _sortedMediaItems;
private readonly Lazy<Option<TimeSpan>> _lazyMinimumDuration;
private readonly IList<MediaItem> _sortedMediaItems;
public SeasonEpisodeMediaCollectionEnumerator(
IEnumerable<MediaItem> mediaItems,
@ -31,11 +31,9 @@ public sealed class SeasonEpisodeMediaCollectionEnumerator : IMediaCollectionEnu @@ -31,11 +31,9 @@ public sealed class SeasonEpisodeMediaCollectionEnumerator : IMediaCollectionEnu
}
}
public void ResetState(CollectionEnumeratorState state)
{
public void ResetState(CollectionEnumeratorState state) =>
// seed doesn't matter here
State.Index = state.Index;
}
public CollectionEnumeratorState State { get; }

10
ErsatzTV.Core/Scheduling/ShuffleInOrderCollectionEnumerator.cs

@ -8,11 +8,11 @@ public class ShuffleInOrderCollectionEnumerator : IMediaCollectionEnumerator @@ -8,11 +8,11 @@ public class ShuffleInOrderCollectionEnumerator : IMediaCollectionEnumerator
{
private readonly CancellationToken _cancellationToken;
private readonly IList<CollectionWithItems> _collections;
private readonly Lazy<Option<TimeSpan>> _lazyMinimumDuration;
private readonly int _mediaItemCount;
private readonly bool _randomStartPoint;
private Random _random;
private IList<MediaItem> _shuffled;
private readonly Lazy<Option<TimeSpan>> _lazyMinimumDuration;
public ShuffleInOrderCollectionEnumerator(
IList<CollectionWithItems> collections,
@ -82,6 +82,10 @@ public class ShuffleInOrderCollectionEnumerator : IMediaCollectionEnumerator @@ -82,6 +82,10 @@ public class ShuffleInOrderCollectionEnumerator : IMediaCollectionEnumerator
State.Index %= _shuffled.Count;
}
public Option<TimeSpan> MinimumDuration => _lazyMinimumDuration.Value;
public int Count => _shuffled.Count;
private IList<MediaItem> Shuffle(IList<CollectionWithItems> collections, Random random)
{
// based on https://keyj.emphy.de/balanced-shuffle/
@ -217,8 +221,4 @@ public class ShuffleInOrderCollectionEnumerator : IMediaCollectionEnumerator @@ -217,8 +221,4 @@ public class ShuffleInOrderCollectionEnumerator : IMediaCollectionEnumerator
public int Index { get; set; }
public IList<Option<MediaItem>> Items { get; set; }
}
public Option<TimeSpan> MinimumDuration => _lazyMinimumDuration.Value;
public int Count => _shuffled.Count;
}

10
ErsatzTV.Core/Scheduling/ShuffledMediaCollectionEnumerator.cs

@ -7,9 +7,9 @@ namespace ErsatzTV.Core.Scheduling; @@ -7,9 +7,9 @@ namespace ErsatzTV.Core.Scheduling;
public class ShuffledMediaCollectionEnumerator : IMediaCollectionEnumerator
{
private readonly CancellationToken _cancellationToken;
private readonly Lazy<Option<TimeSpan>> _lazyMinimumDuration;
private readonly int _mediaItemCount;
private readonly IList<GroupedMediaItem> _mediaItems;
private readonly Lazy<Option<TimeSpan>> _lazyMinimumDuration;
private CloneableRandom _random;
private IList<MediaItem> _shuffled;
@ -79,6 +79,10 @@ public class ShuffledMediaCollectionEnumerator : IMediaCollectionEnumerator @@ -79,6 +79,10 @@ public class ShuffledMediaCollectionEnumerator : IMediaCollectionEnumerator
State.Index %= _mediaItemCount;
}
public Option<TimeSpan> MinimumDuration => _lazyMinimumDuration.Value;
public int Count => _shuffled.Count;
private IList<MediaItem> Shuffle(IEnumerable<GroupedMediaItem> list, CloneableRandom random)
{
GroupedMediaItem[] copy = list.ToArray();
@ -93,8 +97,4 @@ public class ShuffledMediaCollectionEnumerator : IMediaCollectionEnumerator @@ -93,8 +97,4 @@ public class ShuffledMediaCollectionEnumerator : IMediaCollectionEnumerator
return GroupedMediaItem.FlattenGroups(copy, _mediaItemCount);
}
public Option<TimeSpan> MinimumDuration => _lazyMinimumDuration.Value;
public int Count => _shuffled.Count;
}

6
ErsatzTV.Core/SystemStartup.cs

@ -5,12 +5,12 @@ public class SystemStartup @@ -5,12 +5,12 @@ public class SystemStartup
private readonly SemaphoreSlim _databaseStartup = new(0, 100);
private readonly SemaphoreSlim _searchIndexStartup = new(0, 100);
public event EventHandler OnDatabaseReady;
public event EventHandler OnSearchIndexReady;
public bool IsDatabaseReady { get; private set; }
public bool IsSearchIndexReady { get; private set; }
public event EventHandler OnDatabaseReady;
public event EventHandler OnSearchIndexReady;
public async Task WaitForDatabase(CancellationToken cancellationToken) =>
await _databaseStartup.WaitAsync(cancellationToken);

2
ErsatzTV.FFmpeg.Tests/ErsatzTV.FFmpeg.Tests.csproj

@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.11.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.0" />
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />

6
ErsatzTV.FFmpeg/Capabilities/NvidiaHardwareCapabilities.cs

@ -105,6 +105,9 @@ public class NvidiaHardwareCapabilities : IHardwareCapabilities @@ -105,6 +105,9 @@ public class NvidiaHardwareCapabilities : IHardwareCapabilities
return isHardware ? FFmpegCapability.Hardware : FFmpegCapability.Software;
}
public Option<RateControlMode> GetRateControlMode(string videoFormat, Option<IPixelFormat> maybePixelFormat) =>
Option<RateControlMode>.None;
private FFmpegCapability CheckHardwareCodec(string codec, Func<string, bool> check)
{
if (check(codec))
@ -115,7 +118,4 @@ public class NvidiaHardwareCapabilities : IHardwareCapabilities @@ -115,7 +118,4 @@ public class NvidiaHardwareCapabilities : IHardwareCapabilities
_logger.LogWarning("FFmpeg does not contain codec {Codec}; will fall back to software codec", codec);
return FFmpegCapability.Software;
}
public Option<RateControlMode> GetRateControlMode(string videoFormat, Option<IPixelFormat> maybePixelFormat) =>
Option<RateControlMode>.None;
}

5
ErsatzTV.FFmpeg/Capabilities/Vaapi/VaapiProfileEntrypoint.cs

@ -6,8 +6,5 @@ public record VaapiProfileEntrypoint(string VaapiProfile, string VaapiEntrypoint @@ -6,8 +6,5 @@ public record VaapiProfileEntrypoint(string VaapiProfile, string VaapiEntrypoint
public IReadOnlyCollection<RateControlMode> RateControlModes => _rateControlModes;
public bool AddRateControlMode(RateControlMode mode)
{
return _rateControlModes.Add(mode);
}
public bool AddRateControlMode(RateControlMode mode) => _rateControlModes.Add(mode);
}

60
ErsatzTV.FFmpeg/Capabilities/VaapiHardwareCapabilities.cs

@ -31,112 +31,128 @@ public class VaapiHardwareCapabilities : IHardwareCapabilities @@ -31,112 +31,128 @@ public class VaapiHardwareCapabilities : IHardwareCapabilities
(VideoFormat.H264, "baseline" or "66") => false,
(VideoFormat.H264, "main" or "77") =>
_profileEntrypoints.Any(e => e is
_profileEntrypoints.Any(
e => e is
{
VaapiProfile: VaapiProfile.H264Main,
VaapiEntrypoint: VaapiEntrypoint.Decode
}),
(VideoFormat.H264, "high" or "100") =>
_profileEntrypoints.Any(e => e is
_profileEntrypoints.Any(
e => e is
{
VaapiProfile: VaapiProfile.H264High,
VaapiEntrypoint: VaapiEntrypoint.Decode
}),
(VideoFormat.H264, "high 10" or "110") =>
_profileEntrypoints.Any(e => e is
_profileEntrypoints.Any(
e => e is
{
VaapiProfile: VaapiProfile.H264High,
VaapiEntrypoint: VaapiEntrypoint.Decode
}),
(VideoFormat.H264, "baseline constrained" or "578") =>
_profileEntrypoints.Any(e => e is
_profileEntrypoints.Any(
e => e is
{
VaapiProfile: VaapiProfile.H264ConstrainedBaseline,
VaapiEntrypoint: VaapiEntrypoint.Decode
}),
(VideoFormat.Mpeg2Video, "main" or "4") =>
_profileEntrypoints.Any(e => e is
_profileEntrypoints.Any(
e => e is
{
VaapiProfile: VaapiProfile.Mpeg2Main,
VaapiEntrypoint: VaapiEntrypoint.Decode
}),
(VideoFormat.Mpeg2Video, "simple" or "5") =>
_profileEntrypoints.Any(e => e is
_profileEntrypoints.Any(
e => e is
{
VaapiProfile: VaapiProfile.Mpeg2Simple,
VaapiEntrypoint: VaapiEntrypoint.Decode
}),
(VideoFormat.Vc1, "simple" or "0") =>
_profileEntrypoints.Any(e => e is
_profileEntrypoints.Any(
e => e is
{
VaapiProfile: VaapiProfile.Vc1Simple,
VaapiEntrypoint: VaapiEntrypoint.Decode
}),
(VideoFormat.Vc1, "main" or "1") =>
_profileEntrypoints.Any(e => e is
_profileEntrypoints.Any(
e => e is
{
VaapiProfile: VaapiProfile.Vc1Main,
VaapiEntrypoint: VaapiEntrypoint.Decode
}),
(VideoFormat.Vc1, "advanced" or "3") =>
_profileEntrypoints.Any(e => e is
_profileEntrypoints.Any(
e => e is
{
VaapiProfile: VaapiProfile.Vc1Advanced,
VaapiEntrypoint: VaapiEntrypoint.Decode
}),
(VideoFormat.Hevc, "main" or "1") =>
_profileEntrypoints.Any(e => e is
_profileEntrypoints.Any(
e => e is
{
VaapiProfile: VaapiProfile.HevcMain,
VaapiEntrypoint: VaapiEntrypoint.Decode
}),
(VideoFormat.Hevc, "main 10" or "2") =>
_profileEntrypoints.Any(e => e is
_profileEntrypoints.Any(
e => e is
{
VaapiProfile: VaapiProfile.HevcMain10,
VaapiEntrypoint: VaapiEntrypoint.Decode
}),
(VideoFormat.Vp9, "profile 0" or "0") =>
_profileEntrypoints.Any(e => e is
_profileEntrypoints.Any(
e => e is
{
VaapiProfile: VaapiProfile.Vp9Profile0,
VaapiEntrypoint: VaapiEntrypoint.Decode
}),
(VideoFormat.Vp9, "profile 1" or "1") =>
_profileEntrypoints.Any(e => e is
_profileEntrypoints.Any(
e => e is
{
VaapiProfile: VaapiProfile.Vp9Profile1,
VaapiEntrypoint: VaapiEntrypoint.Decode
}),
(VideoFormat.Vp9, "profile 2" or "2") =>
_profileEntrypoints.Any(e => e is
_profileEntrypoints.Any(
e => e is
{
VaapiProfile: VaapiProfile.Vp9Profile2,
VaapiEntrypoint: VaapiEntrypoint.Decode
}),
(VideoFormat.Vp9, "profile 3" or "3") =>
_profileEntrypoints.Any(e => e is
_profileEntrypoints.Any(
e => e is
{
VaapiProfile: VaapiProfile.Vp9Profile3,
VaapiEntrypoint: VaapiEntrypoint.Decode
}),
(VideoFormat.Av1, "main" or "0") =>
_profileEntrypoints.Any(e => e is
_profileEntrypoints.Any(
e => e is
{
VaapiProfile: VaapiProfile.Av1Profile0,
VaapiEntrypoint: VaapiEntrypoint.Decode
@ -170,28 +186,32 @@ public class VaapiHardwareCapabilities : IHardwareCapabilities @@ -170,28 +186,32 @@ public class VaapiHardwareCapabilities : IHardwareCapabilities
VideoFormat.H264 when bitDepth == 10 => false,
VideoFormat.H264 =>
_profileEntrypoints.Any(e => e is
_profileEntrypoints.Any(
e => e is
{
VaapiProfile: VaapiProfile.H264Main,
VaapiEntrypoint: VaapiEntrypoint.Encode or VaapiEntrypoint.EncodeLowPower
}),
VideoFormat.Hevc when bitDepth == 10 =>
_profileEntrypoints.Any(e => e is
_profileEntrypoints.Any(
e => e is
{
VaapiProfile: VaapiProfile.HevcMain10,
VaapiEntrypoint: VaapiEntrypoint.Encode or VaapiEntrypoint.EncodeLowPower
}),
VideoFormat.Hevc =>
_profileEntrypoints.Any(e => e is
_profileEntrypoints.Any(
e => e is
{
VaapiProfile: VaapiProfile.HevcMain,
VaapiEntrypoint: VaapiEntrypoint.Encode or VaapiEntrypoint.EncodeLowPower
}),
VideoFormat.Mpeg2Video =>
_profileEntrypoints.Any(e => e is
_profileEntrypoints.Any(
e => e is
{
VaapiProfile: VaapiProfile.Mpeg2Main,
VaapiEntrypoint: VaapiEntrypoint.Encode or VaapiEntrypoint.EncodeLowPower

5
ErsatzTV.FFmpeg/Filter/ComplexFilter.cs

@ -238,7 +238,10 @@ public class ComplexFilter : IPipelineStep @@ -238,7 +238,10 @@ public class ComplexFilter : IPipelineStep
foreach (SubtitleInputFile subtitleInputFile in _maybeSubtitleInputFile.Filter(
s => s.Method == SubtitleMethod.Copy ||
s is { IsImageBased: true, Method: SubtitleMethod.Convert })) // TODO: support converting text subtitles?
s is
{
IsImageBased: true, Method: SubtitleMethod.Convert
})) // TODO: support converting text subtitles?
{
if (subtitleInputFile.Streams.Any())
{

3
ErsatzTV.FFmpeg/Option/Mp4OutputOptions.cs

@ -2,5 +2,6 @@ @@ -2,5 +2,6 @@
public class Mp4OutputOptions : OutputOption
{
public override IList<string> OutputOptions => new List<string> { "-movflags", "+faststart+frag_keyframe+separate_moof+omit_tfhd_offset+empty_moov+delay_moov" };
public override IList<string> OutputOptions => new List<string>
{ "-movflags", "+faststart+frag_keyframe+separate_moof+omit_tfhd_offset+empty_moov+delay_moov" };
}

2
ErsatzTV.Infrastructure.Tests/ErsatzTV.Infrastructure.Tests.csproj

@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.11.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.0" />
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />

2
ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj

@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
<PackageReference Include="Blurhash.ImageSharp" Version="3.0.0" />
<PackageReference Include="CliWrap" Version="3.6.4" />
<PackageReference Include="Dapper" Version="2.0.143" />
<PackageReference Include="Jint" Version="3.0.0-beta-2049" />
<PackageReference Include="Jint" Version="3.0.0-beta-2050" />
<PackageReference Include="Lucene.Net" Version="4.8.0-beta00016" />
<PackageReference Include="Lucene.Net.Analysis.Common" Version="4.8.0-beta00016" />
<PackageReference Include="Lucene.Net.QueryParser" Version="4.8.0-beta00016" />

10
ErsatzTV.Infrastructure/Scheduling/MultiEpisodeShuffleCollectionEnumerator.cs

@ -10,13 +10,13 @@ namespace ErsatzTV.Infrastructure.Scheduling; @@ -10,13 +10,13 @@ namespace ErsatzTV.Infrastructure.Scheduling;
public class MultiEpisodeShuffleCollectionEnumerator : IMediaCollectionEnumerator
{
private readonly CancellationToken _cancellationToken;
private readonly Lazy<Option<TimeSpan>> _lazyMinimumDuration;
private readonly ILogger _logger;
private readonly int _mediaItemCount;
private readonly Dictionary<int, List<MediaItem>> _mediaItemGroups;
private readonly List<MediaItem> _ungrouped;
private CloneableRandom _random;
private IList<MediaItem> _shuffled;
private readonly Lazy<Option<TimeSpan>> _lazyMinimumDuration;
public MultiEpisodeShuffleCollectionEnumerator(
ICollection<MediaItem> mediaItems,
@ -126,6 +126,10 @@ public class MultiEpisodeShuffleCollectionEnumerator : IMediaCollectionEnumerato @@ -126,6 +126,10 @@ public class MultiEpisodeShuffleCollectionEnumerator : IMediaCollectionEnumerato
State.Index %= _mediaItemCount;
}
public Option<TimeSpan> MinimumDuration => _lazyMinimumDuration.Value;
public int Count => _shuffled.Count;
private IList<MediaItem> Shuffle(CloneableRandom random)
{
int maxGroupNumber = _mediaItemGroups.Max(a => a.Key);
@ -188,8 +192,4 @@ public class MultiEpisodeShuffleCollectionEnumerator : IMediaCollectionEnumerato @@ -188,8 +192,4 @@ public class MultiEpisodeShuffleCollectionEnumerator : IMediaCollectionEnumerato
return copy;
}
public Option<TimeSpan> MinimumDuration => _lazyMinimumDuration.Value;
public int Count => _shuffled.Count;
}

4
ErsatzTV.Scanner.Tests/Core/FFmpeg/TranscodingTests.cs

@ -152,7 +152,7 @@ public class TranscodingTests @@ -152,7 +152,7 @@ public class TranscodingTests
new("mpeg2video", "yuv420p"),
// //
new("libx265", "yuv420p"),
new("libx265", "yuv420p10le"),
new("libx265", "yuv420p10le")
//
// new("mpeg4", "yuv420p"),
//
@ -191,7 +191,7 @@ public class TranscodingTests @@ -191,7 +191,7 @@ public class TranscodingTests
{
HardwareAccelerationKind.None,
// HardwareAccelerationKind.Nvenc,
HardwareAccelerationKind.Vaapi,
HardwareAccelerationKind.Vaapi
// HardwareAccelerationKind.Qsv
// HardwareAccelerationKind.VideoToolbox,
// HardwareAccelerationKind.Amf

2
ErsatzTV.Scanner.Tests/ErsatzTV.Scanner.Tests.csproj

@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.11.0" />
<PackageReference Include="LanguageExt.Core" Version="4.4.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.0" />
<PackageReference Include="Moq" Version="4.18.4" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />

6
ErsatzTV/ErsatzTV.csproj

@ -57,9 +57,9 @@ @@ -57,9 +57,9 @@
<PackageReference Include="Bugsnag.AspNet.Core" Version="3.1.0" />
<PackageReference Include="FluentValidation" Version="11.6.0" />
<PackageReference Include="FluentValidation.AspNetCore" Version="11.3.0" />
<PackageReference Include="HtmlSanitizer" Version="8.0.645" />
<PackageReference Include="HtmlSanitizer" Version="8.0.692" />
<PackageReference Include="LanguageExt.Core" Version="4.4.3" />
<PackageReference Include="Markdig" Version="0.31.0" />
<PackageReference Include="Markdig" Version="0.32.0" />
<PackageReference Include="MediatR.Courier.DependencyInjection" Version="5.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="7.0.9" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="7.0.9" />
@ -73,7 +73,7 @@ @@ -73,7 +73,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="MudBlazor" Version="6.7.0" />
<PackageReference Include="MudBlazor" Version="6.8.0" />
<PackageReference Include="NaturalSort.Extension" Version="4.0.0" />
<PackageReference Include="Refit.HttpClientFactory" Version="7.0.0" />
<PackageReference Include="Serilog" Version="3.0.1" />

8
ErsatzTV/Pages/Index.razor

@ -105,7 +105,8 @@ @@ -105,7 +105,8 @@
}
</MudTd>
</RowTemplate>
</MudTable> }
</MudTable>
}
</MudContainer>
@code {
@ -129,10 +130,7 @@ @@ -129,10 +130,7 @@
_cts.Dispose();
}
private async void OnStartupProgress(object sender, EventArgs e)
{
await InvokeAsync(StateHasChanged);
}
private async void OnStartupProgress(object sender, EventArgs e) => await InvokeAsync(StateHasChanged);
protected override async Task OnParametersSetAsync()
{

8
ErsatzTV/Pages/Settings.razor

@ -3,10 +3,10 @@ @@ -3,10 +3,10 @@
@using ErsatzTV.Application.Filler
@using ErsatzTV.Application.HDHR
@using ErsatzTV.Application.MediaItems
@using ErsatzTV.Application.Resolutions
@using ErsatzTV.Application.Watermarks
@using System.Globalization
@using ErsatzTV.Application.Configuration
@using ErsatzTV.Application.Resolutions
@using ErsatzTV.Core.Domain.Filler
@using ErsatzTV.FFmpeg.OutputFormat
@using Serilog.Events
@ -371,11 +371,8 @@ @@ -371,11 +371,8 @@
Right: _ => Snackbar.Add("Successfully saved general settings", Severity.Success));
}
private async Task RefreshCustomResolutions()
{
_customResolutions = await Mediator.Send(new GetAllResolutions(), _cts.Token)
private async Task RefreshCustomResolutions() => _customResolutions = await Mediator.Send(new GetAllResolutions(), _cts.Token)
.Map(list => list.Filter(r => r.IsCustom).ToList());
}
private async Task AddCustomResolution()
{
@ -415,4 +412,5 @@ @@ -415,4 +412,5 @@
await RefreshCustomResolutions();
}
}
}

5
ErsatzTV/Program.cs

@ -43,7 +43,10 @@ public class Program @@ -43,7 +43,10 @@ public class Program
public static async Task<int> Main(string[] args)
{
using var _ = new Mutex(true, "Global\\ErsatzTV.Singleton.74360cd8985c4d1fb6bc9e81887206fe", out bool createdNew);
using var _ = new Mutex(
true,
"Global\\ErsatzTV.Singleton.74360cd8985c4d1fb6bc9e81887206fe",
out bool createdNew);
if (!createdNew)
{
Console.WriteLine("Another instance of ErsatztTV is already running.");

2
ErsatzTV/Services/SchedulerService.cs

@ -21,10 +21,10 @@ namespace ErsatzTV.Services; @@ -21,10 +21,10 @@ namespace ErsatzTV.Services;
public class SchedulerService : BackgroundService
{
private readonly IEntityLocker _entityLocker;
private readonly SystemStartup _systemStartup;
private readonly ILogger<SchedulerService> _logger;
private readonly ChannelWriter<IScannerBackgroundServiceRequest> _scannerWorkerChannel;
private readonly IServiceScopeFactory _serviceScopeFactory;
private readonly SystemStartup _systemStartup;
private readonly ChannelWriter<IBackgroundServiceRequest> _workerChannel;
public SchedulerService(

5
ErsatzTV/Shared/AddCustomResolutionDialog.razor

@ -25,15 +25,12 @@ @@ -25,15 +25,12 @@
private readonly ResolutionEditViewModel _model = new();
private void Submit()
{
private void Submit() =>
// if (!CanSubmit())
// {
// return;
// }
MudDialog.Close(DialogResult.Ok(_model));
}
private void Cancel(MouseEventArgs e)
{

5
ErsatzTV/Shared/MainLayout.razor

@ -204,10 +204,7 @@ @@ -204,10 +204,7 @@
}
}
private async void OnStartupProgress(object sender, EventArgs e)
{
await InvokeAsync(StateHasChanged);
}
private async void OnStartupProgress(object sender, EventArgs e) => await InvokeAsync(StateHasChanged);
protected override async Task OnParametersSetAsync()
{

3
ErsatzTV/ViewModels/ProgramScheduleItemEditViewModel.cs

@ -12,8 +12,8 @@ namespace ErsatzTV.ViewModels; @@ -12,8 +12,8 @@ namespace ErsatzTV.ViewModels;
public class ProgramScheduleItemEditViewModel : INotifyPropertyChanged
{
private ProgramScheduleItemCollectionType _collectionType;
private int? _multipleCount;
private int? _discardToFillAttempts;
private int? _multipleCount;
private TimeSpan? _playoutDuration;
private TimeSpan? _startTime;
@ -103,6 +103,7 @@ public class ProgramScheduleItemEditViewModel : INotifyPropertyChanged @@ -103,6 +103,7 @@ public class ProgramScheduleItemEditViewModel : INotifyPropertyChanged
get => PlayoutMode == PlayoutMode.Duration ? _discardToFillAttempts ?? 0 : null;
set => _discardToFillAttempts = value;
}
public string CustomTitle { get; set; }
public GuideMode GuideMode { get; set; }

Loading…
Cancel
Save