diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml index 069d7e606..18a0b9d21 100644 --- a/.github/workflows/artifacts.yml +++ b/.github/workflows/artifacts.yml @@ -71,8 +71,8 @@ jobs: shell: bash run: | sed -i '' '/Scanner/d' ErsatzTV/ErsatzTV.csproj - dotnet publish ErsatzTV.Scanner/ErsatzTV.Scanner.csproj --framework net8.0 --runtime "${{ matrix.target }}" -c Release -o publish -p:InformationalVersion="${{ inputs.release_version }}-${{ matrix.target }}" -p:EnableCompressionInSingleFile=false -p:DebugType=Embedded -p:PublishSingleFile=true --self-contained true - dotnet publish ErsatzTV/ErsatzTV.csproj --framework net8.0 --runtime "${{ matrix.target }}" -c Release -o publish -p:InformationalVersion="${{ inputs.release_version }}-${{ matrix.target }}" -p:EnableCompressionInSingleFile=false -p:DebugType=Embedded -p:PublishSingleFile=true --self-contained true + dotnet publish ErsatzTV.Scanner/ErsatzTV.Scanner.csproj --framework net9.0 --runtime "${{ matrix.target }}" -c Release -o publish -p:InformationalVersion="${{ inputs.release_version }}-${{ matrix.target }}" -p:EnableCompressionInSingleFile=false -p:DebugType=Embedded -p:PublishSingleFile=true --self-contained true + dotnet publish ErsatzTV/ErsatzTV.csproj --framework net9.0 --runtime "${{ matrix.target }}" -c Release -o publish -p:InformationalVersion="${{ inputs.release_version }}-${{ matrix.target }}" -p:EnableCompressionInSingleFile=false -p:DebugType=Embedded -p:PublishSingleFile=true --self-contained true - name: Bundle shell: bash @@ -190,8 +190,8 @@ jobs: # Build everything sed -i '/Scanner/d' ErsatzTV/ErsatzTV.csproj - dotnet publish ErsatzTV.Scanner/ErsatzTV.Scanner.csproj --framework net8.0 --runtime "${{ matrix.target }}" -c Release -o "scanner" -p:InformationalVersion="${{ inputs.release_version }}-${{ matrix.target }}" -p:EnableCompressionInSingleFile=true -p:DebugType=Embedded -p:PublishSingleFile=true --self-contained true - dotnet publish ErsatzTV/ErsatzTV.csproj --framework net8.0 --runtime "${{ matrix.target }}" -c Release -o "main" -p:InformationalVersion="${{ inputs.release_version }}-${{ matrix.target }}" -p:EnableCompressionInSingleFile=true -p:DebugType=Embedded -p:PublishSingleFile=true --self-contained true + dotnet publish ErsatzTV.Scanner/ErsatzTV.Scanner.csproj --framework net9.0 --runtime "${{ matrix.target }}" -c Release -o "scanner" -p:InformationalVersion="${{ inputs.release_version }}-${{ matrix.target }}" -p:EnableCompressionInSingleFile=true -p:DebugType=Embedded -p:PublishSingleFile=true --self-contained true + dotnet publish ErsatzTV/ErsatzTV.csproj --framework net9.0 --runtime "${{ matrix.target }}" -c Release -o "main" -p:InformationalVersion="${{ inputs.release_version }}-${{ matrix.target }}" -p:EnableCompressionInSingleFile=true -p:DebugType=Embedded -p:PublishSingleFile=true --self-contained true mkdir "$release_name" mv scanner/* "$release_name/" mv main/* "$release_name/" diff --git a/ErsatzTV.Application/ErsatzTV.Application.csproj b/ErsatzTV.Application/ErsatzTV.Application.csproj index 129987803..ace50f56e 100644 --- a/ErsatzTV.Application/ErsatzTV.Application.csproj +++ b/ErsatzTV.Application/ErsatzTV.Application.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 VSTHRD200 enable latest-Recommended @@ -10,18 +10,18 @@ - + - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/ErsatzTV.Application/Subtitles/Commands/ExtractEmbeddedSubtitlesHandler.cs b/ErsatzTV.Application/Subtitles/Commands/ExtractEmbeddedSubtitlesHandler.cs index 67da07740..5fe97e5ba 100644 --- a/ErsatzTV.Application/Subtitles/Commands/ExtractEmbeddedSubtitlesHandler.cs +++ b/ErsatzTV.Application/Subtitles/Commands/ExtractEmbeddedSubtitlesHandler.cs @@ -532,7 +532,7 @@ public class ExtractEmbeddedSubtitlesHandler : IRequestHandler - net8.0 + net9.0 VSTHRD200 enable - + - - - - - - - + + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/ErsatzTV.Core/ErsatzTV.Core.csproj b/ErsatzTV.Core/ErsatzTV.Core.csproj index 8655a936e..07d5dec32 100644 --- a/ErsatzTV.Core/ErsatzTV.Core.csproj +++ b/ErsatzTV.Core/ErsatzTV.Core.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 VSTHRD200 enable latest-Recommended @@ -15,17 +15,17 @@ - - - - + + + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/ErsatzTV.Core/FFmpeg/FFmpegLibraryProcessService.cs b/ErsatzTV.Core/FFmpeg/FFmpegLibraryProcessService.cs index 44edfaedd..ba08fe1d4 100644 --- a/ErsatzTV.Core/FFmpeg/FFmpegLibraryProcessService.cs +++ b/ErsatzTV.Core/FFmpeg/FFmpegLibraryProcessService.cs @@ -442,7 +442,7 @@ public class FFmpegLibraryProcessService : IFFmpegProcessService channel.FFmpegProfile, hlsRealtime); - IDisplaySize desiredResolution = channel.FFmpegProfile.Resolution; + Resolution desiredResolution = channel.FFmpegProfile.Resolution; var fontSize = (int)Math.Round(channel.FFmpegProfile.Resolution.Height / 20.0); var margin = (int)Math.Round(channel.FFmpegProfile.Resolution.Height * 0.05); diff --git a/ErsatzTV.Core/FFmpeg/FFmpegPlaybackSettingsCalculator.cs b/ErsatzTV.Core/FFmpeg/FFmpegPlaybackSettingsCalculator.cs index 463fdffc6..8f48593bb 100644 --- a/ErsatzTV.Core/FFmpeg/FFmpegPlaybackSettingsCalculator.cs +++ b/ErsatzTV.Core/FFmpeg/FFmpegPlaybackSettingsCalculator.cs @@ -89,7 +89,7 @@ public static class FFmpegPlaybackSettingsCalculator if (NeedToScale(ffmpegProfile, videoVersion) && videoVersion.SampleAspectRatio != "0:0") { - IDisplaySize scaledSize = CalculateScaledSize(ffmpegProfile, videoVersion); + DisplaySize scaledSize = CalculateScaledSize(ffmpegProfile, videoVersion); if (!scaledSize.IsSameSizeAs(videoVersion)) { int fixedHeight = scaledSize.Height + scaledSize.Height % 2; @@ -234,14 +234,14 @@ public static class FFmpegPlaybackSettingsCalculator IsOddSize(version) || TooSmallToCrop(ffmpegProfile, version); - private static bool IsIncorrectSize(IDisplaySize desiredResolution, MediaVersion version) => + private static bool IsIncorrectSize(Resolution desiredResolution, MediaVersion version) => IsAnamorphic(version) || version.Width != desiredResolution.Width || version.Height != desiredResolution.Height; - private static bool IsTooLarge(IDisplaySize desiredResolution, IDisplaySize displaySize) => - displaySize.Height > desiredResolution.Height || - displaySize.Width > desiredResolution.Width; + private static bool IsTooLarge(Resolution desiredResolution, MediaVersion version) => + version.Height > desiredResolution.Height || + version.Width > desiredResolution.Width; private static bool IsOddSize(MediaVersion version) => version.Height % 2 == 1 || version.Width % 2 == 1; @@ -258,13 +258,13 @@ public static class FFmpegPlaybackSettingsCalculator private static DisplaySize CalculateScaledSize(FFmpegProfile ffmpegProfile, MediaVersion version) { - IDisplaySize sarSize = SARSize(version); + DisplaySize sarSize = SARSize(version); int p = version.Width * sarSize.Width; int q = version.Height * sarSize.Height; int g = Gcd(q, p); p = p / g; q = q / g; - IDisplaySize targetSize = ffmpegProfile.Resolution; + Resolution targetSize = ffmpegProfile.Resolution; int hw1 = targetSize.Width; int hh1 = hw1 * q / p; int hh2 = targetSize.Height; diff --git a/ErsatzTV.Core/FFmpeg/FFmpegProcessService.cs b/ErsatzTV.Core/FFmpeg/FFmpegProcessService.cs index e346e0160..57876c9a3 100644 --- a/ErsatzTV.Core/FFmpeg/FFmpegProcessService.cs +++ b/ErsatzTV.Core/FFmpeg/FFmpegProcessService.cs @@ -151,7 +151,7 @@ public class FFmpegProcessService } } - private static bool NeedToPad(IDisplaySize target, IDisplaySize displaySize) => + private static bool NeedToPad(Resolution target, IDisplaySize displaySize) => displaySize.Width != target.Width || displaySize.Height != target.Height; internal async Task GetWatermarkOptions( diff --git a/ErsatzTV.Core/Scheduling/ChronologicalMediaCollectionEnumerator.cs b/ErsatzTV.Core/Scheduling/ChronologicalMediaCollectionEnumerator.cs index b631eb0d8..0d600e33f 100644 --- a/ErsatzTV.Core/Scheduling/ChronologicalMediaCollectionEnumerator.cs +++ b/ErsatzTV.Core/Scheduling/ChronologicalMediaCollectionEnumerator.cs @@ -7,7 +7,7 @@ namespace ErsatzTV.Core.Scheduling; public sealed class ChronologicalMediaCollectionEnumerator : IMediaCollectionEnumerator { private readonly Lazy> _lazyMinimumDuration; - private readonly IList _sortedMediaItems; + private readonly List _sortedMediaItems; public ChronologicalMediaCollectionEnumerator( IEnumerable mediaItems, @@ -39,7 +39,7 @@ public sealed class ChronologicalMediaCollectionEnumerator : IMediaCollectionEnu public CollectionEnumeratorState State { get; } - public Option Current => _sortedMediaItems.Any() ? _sortedMediaItems[State.Index] : None; + public Option Current => _sortedMediaItems.Count != 0 ? _sortedMediaItems[State.Index] : None; public Option CurrentIncludeInProgramGuide { get; } public void MoveNext() => State.Index = (State.Index + 1) % _sortedMediaItems.Count; diff --git a/ErsatzTV.Core/Scheduling/CustomOrderCollectionEnumerator.cs b/ErsatzTV.Core/Scheduling/CustomOrderCollectionEnumerator.cs index 4b3ab4fec..05c289c07 100644 --- a/ErsatzTV.Core/Scheduling/CustomOrderCollectionEnumerator.cs +++ b/ErsatzTV.Core/Scheduling/CustomOrderCollectionEnumerator.cs @@ -8,7 +8,7 @@ public class CustomOrderCollectionEnumerator : IMediaCollectionEnumerator { private readonly Lazy> _lazyMinimumDuration; - private readonly IList _sortedMediaItems; + private readonly List _sortedMediaItems; public CustomOrderCollectionEnumerator( Collection collection, @@ -38,7 +38,7 @@ public class CustomOrderCollectionEnumerator : IMediaCollectionEnumerator public CollectionEnumeratorState State { get; } - public Option Current => _sortedMediaItems.Any() ? _sortedMediaItems[State.Index] : None; + public Option Current => _sortedMediaItems.Count != 0 ? _sortedMediaItems[State.Index] : None; public Option CurrentIncludeInProgramGuide { get; } public void MoveNext() => State.Index = (State.Index + 1) % _sortedMediaItems.Count; diff --git a/ErsatzTV.Core/Scheduling/OrderedScheduleItemsEnumerator.cs b/ErsatzTV.Core/Scheduling/OrderedScheduleItemsEnumerator.cs index 5b179b0cb..d8c2dab57 100644 --- a/ErsatzTV.Core/Scheduling/OrderedScheduleItemsEnumerator.cs +++ b/ErsatzTV.Core/Scheduling/OrderedScheduleItemsEnumerator.cs @@ -5,7 +5,7 @@ namespace ErsatzTV.Core.Scheduling; public class OrderedScheduleItemsEnumerator : IScheduleItemsEnumerator { - private readonly IList _sortedScheduleItems; + private readonly List _sortedScheduleItems; public OrderedScheduleItemsEnumerator( IEnumerable scheduleItems, diff --git a/ErsatzTV.Core/Scheduling/RandomizedRotatingMediaCollectionEnumerator.cs b/ErsatzTV.Core/Scheduling/RandomizedRotatingMediaCollectionEnumerator.cs index efe29917f..1d0c7d3f5 100644 --- a/ErsatzTV.Core/Scheduling/RandomizedRotatingMediaCollectionEnumerator.cs +++ b/ErsatzTV.Core/Scheduling/RandomizedRotatingMediaCollectionEnumerator.cs @@ -65,7 +65,7 @@ public class RandomizedRotatingMediaCollectionEnumerator : IMediaCollectionEnume public void MoveNext() { - IList groups = _groupMedia.Keys.ToList(); + var groups = _groupMedia.Keys.ToList(); int nextRandom = _random.Next(); int groupNumber = nextRandom % groups.Count; diff --git a/ErsatzTV.Core/Scheduling/SeasonEpisodeMediaCollectionEnumerator.cs b/ErsatzTV.Core/Scheduling/SeasonEpisodeMediaCollectionEnumerator.cs index 88b1e00b8..cb381a6f8 100644 --- a/ErsatzTV.Core/Scheduling/SeasonEpisodeMediaCollectionEnumerator.cs +++ b/ErsatzTV.Core/Scheduling/SeasonEpisodeMediaCollectionEnumerator.cs @@ -7,7 +7,7 @@ namespace ErsatzTV.Core.Scheduling; public sealed class SeasonEpisodeMediaCollectionEnumerator : IMediaCollectionEnumerator { private readonly Lazy> _lazyMinimumDuration; - private readonly IList _sortedMediaItems; + private readonly List _sortedMediaItems; public SeasonEpisodeMediaCollectionEnumerator( IEnumerable mediaItems, @@ -39,7 +39,7 @@ public sealed class SeasonEpisodeMediaCollectionEnumerator : IMediaCollectionEnu public CollectionEnumeratorState State { get; } - public Option Current => _sortedMediaItems.Any() ? _sortedMediaItems[State.Index] : None; + public Option Current => _sortedMediaItems.Count != 0 ? _sortedMediaItems[State.Index] : None; public Option CurrentIncludeInProgramGuide { get; } public void MoveNext() => State.Index = (State.Index + 1) % _sortedMediaItems.Count; diff --git a/ErsatzTV.Core/Scheduling/ShuffleInOrderCollectionEnumerator.cs b/ErsatzTV.Core/Scheduling/ShuffleInOrderCollectionEnumerator.cs index 894f28b3e..8c1ab3b5d 100644 --- a/ErsatzTV.Core/Scheduling/ShuffleInOrderCollectionEnumerator.cs +++ b/ErsatzTV.Core/Scheduling/ShuffleInOrderCollectionEnumerator.cs @@ -12,7 +12,7 @@ public class ShuffleInOrderCollectionEnumerator : IMediaCollectionEnumerator private readonly int _mediaItemCount; private readonly bool _randomStartPoint; private Random _random; - private IList _shuffled; + private MediaItem[] _shuffled; public ShuffleInOrderCollectionEnumerator( IList collections, @@ -60,12 +60,12 @@ public class ShuffleInOrderCollectionEnumerator : IMediaCollectionEnumerator public CollectionEnumeratorState State { get; } - public Option Current => _shuffled.Any() ? _shuffled[State.Index % _mediaItemCount] : None; + public Option Current => _shuffled.Length != 0 ? _shuffled[State.Index % _mediaItemCount] : None; public Option CurrentIncludeInProgramGuide { get; } public void MoveNext() { - if ((State.Index + 1) % _shuffled.Count == 0) + if ((State.Index + 1) % _shuffled.Length == 0) { Option tail = Current; @@ -83,12 +83,12 @@ public class ShuffleInOrderCollectionEnumerator : IMediaCollectionEnumerator State.Index++; } - State.Index %= _shuffled.Count; + State.Index %= _shuffled.Length; } public Option MinimumDuration => _lazyMinimumDuration.Value; - public int Count => _shuffled.Count; + public int Count => _shuffled.Length; private MediaItem[] Shuffle(IList collections, Random random) { diff --git a/ErsatzTV.Core/Scheduling/ShuffledScheduleItemsEnumerator.cs b/ErsatzTV.Core/Scheduling/ShuffledScheduleItemsEnumerator.cs index 027d1c9ff..28595409e 100644 --- a/ErsatzTV.Core/Scheduling/ShuffledScheduleItemsEnumerator.cs +++ b/ErsatzTV.Core/Scheduling/ShuffledScheduleItemsEnumerator.cs @@ -8,7 +8,7 @@ public class ShuffledScheduleItemsEnumerator : IScheduleItemsEnumerator private readonly IList _scheduleItems; private readonly int _scheduleItemsCount; private CloneableRandom _random; - private IList _shuffled; + private ProgramScheduleItem[] _shuffled; public ShuffledScheduleItemsEnumerator( IList scheduleItems, @@ -68,7 +68,7 @@ public class ShuffledScheduleItemsEnumerator : IScheduleItemsEnumerator if ((State.Index + offset) % _scheduleItemsCount == 0) { - IList shuffled; + ProgramScheduleItem[] shuffled; ProgramScheduleItem tail = Current; // clone the random diff --git a/ErsatzTV.FFmpeg.Tests/ErsatzTV.FFmpeg.Tests.csproj b/ErsatzTV.FFmpeg.Tests/ErsatzTV.FFmpeg.Tests.csproj index d2ec859c1..f2354248c 100644 --- a/ErsatzTV.FFmpeg.Tests/ErsatzTV.FFmpeg.Tests.csproj +++ b/ErsatzTV.FFmpeg.Tests/ErsatzTV.FFmpeg.Tests.csproj @@ -1,15 +1,15 @@  - net8.0 + net9.0 enable false - - + + diff --git a/ErsatzTV.FFmpeg/ErsatzTV.FFmpeg.csproj b/ErsatzTV.FFmpeg/ErsatzTV.FFmpeg.csproj index e3aaa32ed..e9e8f9375 100644 --- a/ErsatzTV.FFmpeg/ErsatzTV.FFmpeg.csproj +++ b/ErsatzTV.FFmpeg/ErsatzTV.FFmpeg.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 enable enable latest-Recommended @@ -9,10 +9,10 @@ - + - - + + diff --git a/ErsatzTV.Infrastructure.MySql/ErsatzTV.Infrastructure.MySql.csproj b/ErsatzTV.Infrastructure.MySql/ErsatzTV.Infrastructure.MySql.csproj index d21f31913..8d288a13c 100644 --- a/ErsatzTV.Infrastructure.MySql/ErsatzTV.Infrastructure.MySql.csproj +++ b/ErsatzTV.Infrastructure.MySql/ErsatzTV.Infrastructure.MySql.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 enable enable @@ -16,8 +16,8 @@ - - + + diff --git a/ErsatzTV.Infrastructure.Sqlite/ErsatzTV.Infrastructure.Sqlite.csproj b/ErsatzTV.Infrastructure.Sqlite/ErsatzTV.Infrastructure.Sqlite.csproj index e6df2f62a..d016f6196 100644 --- a/ErsatzTV.Infrastructure.Sqlite/ErsatzTV.Infrastructure.Sqlite.csproj +++ b/ErsatzTV.Infrastructure.Sqlite/ErsatzTV.Infrastructure.Sqlite.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 enable enable @@ -13,8 +13,8 @@ - - + + diff --git a/ErsatzTV.Infrastructure.Tests/ErsatzTV.Infrastructure.Tests.csproj b/ErsatzTV.Infrastructure.Tests/ErsatzTV.Infrastructure.Tests.csproj index 3ffb2191b..f81d2be5e 100644 --- a/ErsatzTV.Infrastructure.Tests/ErsatzTV.Infrastructure.Tests.csproj +++ b/ErsatzTV.Infrastructure.Tests/ErsatzTV.Infrastructure.Tests.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 enable enable @@ -9,11 +9,11 @@ - + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj b/ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj index 3e3cd1f55..1133f70d4 100644 --- a/ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj +++ b/ErsatzTV.Infrastructure/ErsatzTV.Infrastructure.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 true VSTHRD200 enable @@ -11,20 +11,20 @@ - + - + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -35,7 +35,7 @@ - + diff --git a/ErsatzTV.Infrastructure/Images/ImageCache.cs b/ErsatzTV.Infrastructure/Images/ImageCache.cs index d07f14fa3..1b858247f 100644 --- a/ErsatzTV.Infrastructure/Images/ImageCache.cs +++ b/ErsatzTV.Infrastructure/Images/ImageCache.cs @@ -48,7 +48,7 @@ public class ImageCache : IImageCache } byte[] hash = await ComputeFileHash(tempFileName); - string hex = BitConverter.ToString(hash).Replace("-", string.Empty); + string hex = Convert.ToHexString(hash); string subfolder = hex[..2]; string baseFolder = artworkKind switch { @@ -82,7 +82,7 @@ public class ImageCache : IImageCache { var filenameKey = $"{path}:{_localFileSystem.GetLastWriteTime(path).ToFileTimeUtc()}"; byte[] hash = Crypto.ComputeHash(Encoding.UTF8.GetBytes(filenameKey)); - string hex = BitConverter.ToString(hash).Replace("-", string.Empty); + string hex = Convert.ToHexString(hash); string subfolder = hex[..2]; string baseFolder = artworkKind switch { diff --git a/ErsatzTV.Infrastructure/Metadata/CollectionEtag.cs b/ErsatzTV.Infrastructure/Metadata/CollectionEtag.cs index 04328b579..ad0f08cc3 100644 --- a/ErsatzTV.Infrastructure/Metadata/CollectionEtag.cs +++ b/ErsatzTV.Infrastructure/Metadata/CollectionEtag.cs @@ -26,6 +26,6 @@ public class CollectionEtag : ICollectionEtag ms.Position = 0; byte[] hash = SHA1.Create().ComputeHash(ms); - return BitConverter.ToString(hash).Replace("-", string.Empty); + return Convert.ToHexString(hash); } } diff --git a/ErsatzTV.Infrastructure/Plex/PlexEtag.cs b/ErsatzTV.Infrastructure/Plex/PlexEtag.cs index ec0d56810..3eae993b2 100644 --- a/ErsatzTV.Infrastructure/Plex/PlexEtag.cs +++ b/ErsatzTV.Infrastructure/Plex/PlexEtag.cs @@ -106,7 +106,7 @@ public class PlexEtag ms.Position = 0; byte[] hash = SHA1.Create().ComputeHash(ms); - return BitConverter.ToString(hash).Replace("-", string.Empty); + return Convert.ToHexString(hash); } public string ForShow(PlexMetadataResponse response) @@ -153,7 +153,7 @@ public class PlexEtag ms.Position = 0; byte[] hash = SHA1.Create().ComputeHash(ms); - return BitConverter.ToString(hash).Replace("-", string.Empty); + return Convert.ToHexString(hash); } public string ForSeason(PlexXmlMetadataResponse response) @@ -191,7 +191,7 @@ public class PlexEtag ms.Position = 0; byte[] hash = SHA1.Create().ComputeHash(ms); - return BitConverter.ToString(hash).Replace("-", string.Empty); + return Convert.ToHexString(hash); } public string ForEpisode(PlexXmlMetadataResponse response) @@ -287,7 +287,7 @@ public class PlexEtag ms.Position = 0; byte[] hash = SHA1.Create().ComputeHash(ms); - return BitConverter.ToString(hash).Replace("-", string.Empty); + return Convert.ToHexString(hash); } public string ForCollection(PlexCollectionMetadataResponse response) @@ -312,7 +312,7 @@ public class PlexEtag ms.Position = 0; byte[] hash = SHA1.Create().ComputeHash(ms); - return BitConverter.ToString(hash).Replace("-", string.Empty); + return Convert.ToHexString(hash); } private enum FieldKey : byte diff --git a/ErsatzTV.Infrastructure/Search/SearchQueryParser.cs b/ErsatzTV.Infrastructure/Search/SearchQueryParser.cs index 3780d9995..f609e1e77 100644 --- a/ErsatzTV.Infrastructure/Search/SearchQueryParser.cs +++ b/ErsatzTV.Infrastructure/Search/SearchQueryParser.cs @@ -67,11 +67,13 @@ public partial class SearchQueryParser(IDbContextFactory dbContextFac using Analyzer analyzerWrapper = AnalyzerWrapper(); - QueryParser parser = new CustomMultiFieldQueryParser( + var parser = new CustomMultiFieldQueryParser( LuceneSearchIndex.AppLuceneVersion, [LuceneSearchIndex.TitleField], - analyzerWrapper); - parser.AllowLeadingWildcard = true; + analyzerWrapper) + { + AllowLeadingWildcard = true + }; Query result = ParseQuery(parsedQuery, parser); Log.Logger.Debug("Search query parsed from [{Query}] to [{ParsedQuery}]", query, result.ToString()); diff --git a/ErsatzTV.Scanner.Tests/ErsatzTV.Scanner.Tests.csproj b/ErsatzTV.Scanner.Tests/ErsatzTV.Scanner.Tests.csproj index 9dfe7ddb0..d6bac833f 100644 --- a/ErsatzTV.Scanner.Tests/ErsatzTV.Scanner.Tests.csproj +++ b/ErsatzTV.Scanner.Tests/ErsatzTV.Scanner.Tests.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 enable enable @@ -10,11 +10,11 @@ - + - + runtime; build; native; contentfiles; analyzers; buildtransitive all diff --git a/ErsatzTV.Scanner/Core/Metadata/MediaServerMovieLibraryScanner.cs b/ErsatzTV.Scanner/Core/Metadata/MediaServerMovieLibraryScanner.cs index d6650efe2..74cce9b10 100644 --- a/ErsatzTV.Scanner/Core/Metadata/MediaServerMovieLibraryScanner.cs +++ b/ErsatzTV.Scanner/Core/Metadata/MediaServerMovieLibraryScanner.cs @@ -73,7 +73,7 @@ public abstract class MediaServerMovieLibraryScanner(); - IReadOnlyDictionary existingMovies = (await movieRepository.GetExistingMovies(library)) + var existingMovies = (await movieRepository.GetExistingMovies(library)) .ToImmutableDictionary(e => e.MediaServerItemId, e => e); await foreach ((TMovie incoming, int totalMovieCount) in movieEntries.WithCancellation(cancellationToken)) @@ -253,7 +253,7 @@ public abstract class MediaServerMovieLibraryScanner ShouldScanItem( IMediaServerMovieRepository movieRepository, TLibrary library, - IReadOnlyDictionary existingMovies, + ImmutableDictionary existingMovies, TMovie incoming, string localPath, bool deepScan) diff --git a/ErsatzTV.Scanner/Core/Metadata/MediaServerOtherVideoLibraryScanner.cs b/ErsatzTV.Scanner/Core/Metadata/MediaServerOtherVideoLibraryScanner.cs index dd3664c1c..e25e2999e 100644 --- a/ErsatzTV.Scanner/Core/Metadata/MediaServerOtherVideoLibraryScanner.cs +++ b/ErsatzTV.Scanner/Core/Metadata/MediaServerOtherVideoLibraryScanner.cs @@ -73,7 +73,7 @@ public abstract class MediaServerOtherVideoLibraryScanner(); - IReadOnlyDictionary existingOtherVideos = (await otherVideoRepository.GetExistingOtherVideos(library)) + var existingOtherVideos = (await otherVideoRepository.GetExistingOtherVideos(library)) .ToImmutableDictionary(e => e.MediaServerItemId, e => e); await foreach ((TOtherVideo incoming, int totalOtherVideoCount) in otherVideoEntries.WithCancellation(cancellationToken)) @@ -253,7 +253,7 @@ public abstract class MediaServerOtherVideoLibraryScanner ShouldScanItem( IMediaServerOtherVideoRepository otherVideoRepository, TLibrary library, - IReadOnlyDictionary existingOtherVideos, + ImmutableDictionary existingOtherVideos, TOtherVideo incoming, string localPath, bool deepScan) diff --git a/ErsatzTV.Scanner/ErsatzTV.Scanner.csproj b/ErsatzTV.Scanner/ErsatzTV.Scanner.csproj index 8a6287d41..6b2670a53 100644 --- a/ErsatzTV.Scanner/ErsatzTV.Scanner.csproj +++ b/ErsatzTV.Scanner/ErsatzTV.Scanner.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net9.0 enable enable Debug;Release;Debug No Sync @@ -20,16 +20,16 @@ - + - - - - - - + + + + + + diff --git a/ErsatzTV/ErsatzTV.csproj b/ErsatzTV/ErsatzTV.csproj index b6ca2049c..3dd9b6591 100644 --- a/ErsatzTV/ErsatzTV.csproj +++ b/ErsatzTV/ErsatzTV.csproj @@ -1,7 +1,7 @@ - net8.0 + net9.0 true Latest false @@ -18,31 +18,31 @@ - - - - + + + + - + - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - - - + + + @@ -50,7 +50,7 @@ - + diff --git a/ErsatzTV/Pages/DecoTemplateEditor.razor b/ErsatzTV/Pages/DecoTemplateEditor.razor index 07cd464f3..1fc0bc934 100644 --- a/ErsatzTV/Pages/DecoTemplateEditor.razor +++ b/ErsatzTV/Pages/DecoTemplateEditor.razor @@ -111,7 +111,8 @@ - -