nvidia decoder fixes (#2041)
* replace FluentAssertions with Shouldly * fix song transcoding tests * only specify hwaccel when hardware decode is required * update changelog
This commit is contained in:
@@ -25,7 +25,7 @@ using ErsatzTV.FFmpeg.State;
|
||||
using ErsatzTV.Infrastructure.Images;
|
||||
using ErsatzTV.Infrastructure.Metadata;
|
||||
using ErsatzTV.Infrastructure.Runtime;
|
||||
using FluentAssertions;
|
||||
using Shouldly;
|
||||
using Microsoft.Extensions.Caching.Memory;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using NSubstitute;
|
||||
@@ -109,18 +109,18 @@ public class TranscodingTests
|
||||
{
|
||||
public static Watermark[] Watermarks =
|
||||
[
|
||||
Watermark.None
|
||||
//Watermark.PermanentOpaqueScaled,
|
||||
// Watermark.PermanentOpaqueActualSize,
|
||||
//Watermark.PermanentTransparentScaled
|
||||
// Watermark.PermanentTransparentActualSize
|
||||
Watermark.None,
|
||||
Watermark.PermanentOpaqueScaled,
|
||||
Watermark.PermanentOpaqueActualSize,
|
||||
Watermark.PermanentTransparentScaled,
|
||||
Watermark.PermanentTransparentActualSize
|
||||
];
|
||||
|
||||
public static Subtitle[] Subtitles =
|
||||
[
|
||||
Subtitle.None
|
||||
//Subtitle.Picture,
|
||||
//Subtitle.Text
|
||||
Subtitle.None,
|
||||
Subtitle.Picture,
|
||||
Subtitle.Text
|
||||
];
|
||||
|
||||
public static Padding[] Paddings =
|
||||
@@ -190,7 +190,7 @@ public class TranscodingTests
|
||||
|
||||
public static FFmpegProfileVideoFormat[] VideoFormats =
|
||||
[
|
||||
FFmpegProfileVideoFormat.H264,
|
||||
//FFmpegProfileVideoFormat.H264,
|
||||
FFmpegProfileVideoFormat.Hevc
|
||||
// FFmpegProfileVideoFormat.Mpeg2Video
|
||||
];
|
||||
@@ -199,7 +199,7 @@ public class TranscodingTests
|
||||
[
|
||||
HardwareAccelerationKind.None,
|
||||
//HardwareAccelerationKind.Nvenc,
|
||||
HardwareAccelerationKind.Vaapi
|
||||
//HardwareAccelerationKind.Vaapi
|
||||
//HardwareAccelerationKind.Qsv,
|
||||
// HardwareAccelerationKind.VideoToolbox,
|
||||
// HardwareAccelerationKind.Amf
|
||||
@@ -209,7 +209,7 @@ public class TranscodingTests
|
||||
[
|
||||
StreamingMode.TransportStream,
|
||||
//StreamingMode.HttpLiveStreamingSegmenter,
|
||||
StreamingMode.HttpLiveStreamingSegmenterV2
|
||||
//StreamingMode.HttpLiveStreamingSegmenterV2
|
||||
];
|
||||
|
||||
public static string[] FilesToTest => [string.Empty];
|
||||
@@ -245,6 +245,12 @@ public class TranscodingTests
|
||||
Arg.Any<Option<int>>())
|
||||
.Returns(Path.Combine(TestContext.CurrentContext.TestDirectory, "Resources", "ErsatzTV.png"));
|
||||
|
||||
mockImageCache.GetPathForImage(
|
||||
Arg.Any<string>(),
|
||||
Arg.Is<ArtworkKind>(x => x == ArtworkKind.Thumbnail),
|
||||
Arg.Any<Option<int>>())
|
||||
.Returns(Path.Combine(TestContext.CurrentContext.TestDirectory, "Resources", "song_album_cover_512.png"));
|
||||
|
||||
var oldService = new FFmpegProcessService(
|
||||
new FakeStreamSelector(),
|
||||
mockImageCache,
|
||||
@@ -484,7 +490,7 @@ public class TranscodingTests
|
||||
|
||||
if (videoScanKind == VideoScanKind.Interlaced)
|
||||
{
|
||||
v.VideoScanKind.Should().Be(VideoScanKind.Interlaced, file);
|
||||
v.VideoScanKind.ShouldBe(VideoScanKind.Interlaced, file);
|
||||
}
|
||||
|
||||
var subtitleStreams = v.Streams
|
||||
@@ -559,7 +565,7 @@ public class TranscodingTests
|
||||
bool hasDeinterlaceFilter = filterChain.VideoFilterSteps.Any(
|
||||
s => s is YadifFilter or YadifCudaFilter or DeinterlaceQsvFilter or DeinterlaceVaapiFilter);
|
||||
|
||||
hasDeinterlaceFilter.Should().Be(videoScanKind == VideoScanKind.Interlaced);
|
||||
hasDeinterlaceFilter.ShouldBe(videoScanKind == VideoScanKind.Interlaced);
|
||||
|
||||
bool hasScaling = filterChain.VideoFilterSteps.Filter(
|
||||
s => s is ScaleFilter or ScaleCudaFilter or ScaleQsvFilter or ScaleVaapiFilter)
|
||||
@@ -569,7 +575,7 @@ public class TranscodingTests
|
||||
// TODO: sometimes scaling is used for pixel format, so this is harder to assert the absence
|
||||
if (profileResolution.Width != 1920 && profileResolution.Width != 640)
|
||||
{
|
||||
hasScaling.Should().BeTrue();
|
||||
hasScaling.ShouldBeTrue();
|
||||
}
|
||||
|
||||
// TODO: bit depth
|
||||
@@ -577,16 +583,16 @@ public class TranscodingTests
|
||||
bool hasPadding = filterChain.VideoFilterSteps.Any(s => s is PadFilter);
|
||||
|
||||
// TODO: optimize out padding
|
||||
// hasPadding.Should().Be(padding == Padding.WithPadding);
|
||||
// hasPadding.ShouldBe(padding == Padding.WithPadding);
|
||||
if (padding is Padding.WithPadding && scalingBehavior is not ScalingBehavior.Crop)
|
||||
{
|
||||
hasPadding.Should().BeTrue();
|
||||
hasPadding.ShouldBeTrue();
|
||||
}
|
||||
|
||||
bool hasCrop = filterChain.VideoFilterSteps.Any(s => s is CropFilter);
|
||||
if (scalingBehavior is ScalingBehavior.Crop)
|
||||
{
|
||||
hasCrop.Should().BeTrue();
|
||||
hasCrop.ShouldBeTrue();
|
||||
}
|
||||
|
||||
bool hasSubtitleFilters =
|
||||
@@ -597,12 +603,12 @@ public class TranscodingTests
|
||||
or OverlaySubtitleQsvFilter
|
||||
or OverlaySubtitleVaapiFilter);
|
||||
|
||||
hasSubtitleFilters.Should().Be(subtitle != Subtitle.None);
|
||||
hasSubtitleFilters.ShouldBe(subtitle != Subtitle.None);
|
||||
|
||||
bool hasWatermarkFilters = filterChain.WatermarkOverlayFilterSteps.Any(
|
||||
s => s is OverlayWatermarkFilter or OverlayWatermarkCudaFilter or OverlayWatermarkQsvFilter);
|
||||
|
||||
hasWatermarkFilters.Should().Be(watermark != Watermark.None);
|
||||
hasWatermarkFilters.ShouldBe(watermark != Watermark.None);
|
||||
}
|
||||
|
||||
FFmpegLibraryProcessService service = GetService();
|
||||
@@ -780,7 +786,7 @@ public class TranscodingTests
|
||||
? p1.StandardError
|
||||
: p1.StandardOutput;
|
||||
|
||||
p1.ExitCode.Should().Be(0, output);
|
||||
p1.ExitCode.ShouldBe(0, output);
|
||||
|
||||
switch (subtitle)
|
||||
{
|
||||
@@ -813,7 +819,7 @@ public class TranscodingTests
|
||||
}
|
||||
}
|
||||
|
||||
p2.ExitCode.Should().Be(0);
|
||||
p2.ExitCode.ShouldBe(0);
|
||||
|
||||
await SetInterlacedFlag(tempFileName, sourceFile, file, videoScanKind == VideoScanKind.Interlaced);
|
||||
|
||||
@@ -850,7 +856,7 @@ public class TranscodingTests
|
||||
}
|
||||
}
|
||||
|
||||
p.ExitCode.Should().Be(0);
|
||||
p.ExitCode.ShouldBe(0);
|
||||
}
|
||||
|
||||
private static string GetStringSha256Hash(string text)
|
||||
@@ -877,6 +883,12 @@ public class TranscodingTests
|
||||
Arg.Any<Option<int>>())
|
||||
.Returns(Path.Combine(TestContext.CurrentContext.TestDirectory, "Resources", "ErsatzTV.png"));
|
||||
|
||||
imageCache.GetPathForImage(
|
||||
Arg.Any<string>(),
|
||||
Arg.Is<ArtworkKind>(x => x == ArtworkKind.Thumbnail),
|
||||
Arg.Any<Option<int>>())
|
||||
.Returns(Path.Combine(TestContext.CurrentContext.TestDirectory, "Resources", "song_album_cover_512.png"));
|
||||
|
||||
var oldService = new FFmpegProcessService(
|
||||
new FakeStreamSelector(),
|
||||
imageCache,
|
||||
@@ -956,7 +968,7 @@ public class TranscodingTests
|
||||
|
||||
if (profileAcceleration != HardwareAccelerationKind.None && isUnsupported)
|
||||
{
|
||||
result.ExitCode.Should().Be(1, $"Error message with successful exit code? {process.Arguments}");
|
||||
result.ExitCode.ShouldBe(1, $"Error message with successful exit code? {process.Arguments}");
|
||||
Assert.Warn($"Unsupported on this hardware: ffmpeg {process.Arguments}");
|
||||
}
|
||||
else if (error.Contains("Impossible to convert between"))
|
||||
@@ -973,7 +985,7 @@ public class TranscodingTests
|
||||
' ',
|
||||
process.Arguments.Split(" ").Map(a => a.Contains('[') ? $"\"{a}\"" : a));
|
||||
|
||||
result.ExitCode.Should().Be(0, error + Environment.NewLine + arguments);
|
||||
result.ExitCode.ShouldBe(0, error + Environment.NewLine + arguments);
|
||||
if (result.ExitCode == 0)
|
||||
{
|
||||
Console.WriteLine(process.Arguments);
|
||||
@@ -998,11 +1010,11 @@ public class TranscodingTests
|
||||
MediaVersion v = getFinalMediaVersion();
|
||||
|
||||
// verify de-interlace
|
||||
v.VideoScanKind.Should().NotBe(VideoScanKind.Interlaced);
|
||||
v.VideoScanKind.ShouldNotBe(VideoScanKind.Interlaced);
|
||||
|
||||
// verify resolution
|
||||
v.Height.Should().Be(profileResolution.Height);
|
||||
v.Width.Should().Be(profileResolution.Width);
|
||||
v.Height.ShouldBe(profileResolution.Height);
|
||||
v.Width.ShouldBe(profileResolution.Width);
|
||||
|
||||
foreach (MediaStream videoStream in v.Streams.Filter(s => s.MediaStreamKind == MediaStreamKind.Video))
|
||||
{
|
||||
@@ -1014,7 +1026,7 @@ public class TranscodingTests
|
||||
_ => PixelFormat.YUV420P
|
||||
};
|
||||
|
||||
videoStream.PixelFormat.Should().Be(expectedPixelFormat);
|
||||
videoStream.PixelFormat.ShouldBe(expectedPixelFormat);
|
||||
|
||||
// verify colors
|
||||
var colorParams = new ColorParams(
|
||||
@@ -1032,7 +1044,7 @@ public class TranscodingTests
|
||||
(profileAcceleration != HardwareAccelerationKind.Vaapi || vaapiDriver != VaapiDriver.RadeonSI) &&
|
||||
streamingMode != StreamingMode.HttpLiveStreamingSegmenterV2)
|
||||
{
|
||||
colorParams.IsBt709.Should().BeTrue($"{colorParams}");
|
||||
colorParams.IsBt709.ShouldBeTrue($"{colorParams}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ using ErsatzTV.Core.Domain;
|
||||
using ErsatzTV.Core.Interfaces.Repositories;
|
||||
using ErsatzTV.Scanner.Core.Metadata;
|
||||
using ErsatzTV.Scanner.Tests.Core.Fakes;
|
||||
using FluentAssertions;
|
||||
using Shouldly;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using NSubstitute;
|
||||
using NUnit.Framework;
|
||||
@@ -57,14 +57,14 @@ public class LocalSubtitlesProviderTests
|
||||
@"/Movies/Avatar (2009)/Avatar (2009).mkv",
|
||||
true);
|
||||
|
||||
result.Count.Should().Be(5);
|
||||
result.Count(s => s.Language == "eng").Should().Be(3);
|
||||
result.Count(s => s.Language == "deu").Should().Be(2);
|
||||
result.Count(s => s.Forced).Should().Be(2);
|
||||
result.Count(s => s.SDH).Should().Be(2);
|
||||
result.Count(s => s.Codec == "subrip").Should().Be(4);
|
||||
result.Count(s => s.Codec == "ass").Should().Be(1);
|
||||
result.All(s => s.Path.Contains(@"/Movies/Avatar (2009)/")).Should().BeTrue();
|
||||
result.Count.ShouldBe(5);
|
||||
result.Count(s => s.Language == "eng").ShouldBe(3);
|
||||
result.Count(s => s.Language == "deu").ShouldBe(2);
|
||||
result.Count(s => s.Forced).ShouldBe(2);
|
||||
result.Count(s => s.SDH).ShouldBe(2);
|
||||
result.Count(s => s.Codec == "subrip").ShouldBe(4);
|
||||
result.Count(s => s.Codec == "ass").ShouldBe(1);
|
||||
result.All(s => s.Path.Contains(@"/Movies/Avatar (2009)/")).ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -102,13 +102,13 @@ public class LocalSubtitlesProviderTests
|
||||
@"/Movies/Avatar (2009)/Avatar (2009).mkv",
|
||||
false);
|
||||
|
||||
result.Count.Should().Be(7);
|
||||
result.Count(s => s.Language == "eng").Should().Be(5);
|
||||
result.Count(s => s.Language == "deu").Should().Be(2);
|
||||
result.Count(s => s.Forced).Should().Be(3);
|
||||
result.Count(s => s.SDH).Should().Be(3);
|
||||
result.Count(s => s.Codec == "subrip").Should().Be(5);
|
||||
result.Count(s => s.Codec == "ass").Should().Be(2);
|
||||
result.Count(s => s.Path.Contains(@"/Movies/Avatar (2009)/")).Should().Be(0);
|
||||
result.Count.ShouldBe(7);
|
||||
result.Count(s => s.Language == "eng").ShouldBe(5);
|
||||
result.Count(s => s.Language == "deu").ShouldBe(2);
|
||||
result.Count(s => s.Forced).ShouldBe(3);
|
||||
result.Count(s => s.SDH).ShouldBe(3);
|
||||
result.Count(s => s.Codec == "subrip").ShouldBe(5);
|
||||
result.Count(s => s.Codec == "ass").ShouldBe(2);
|
||||
result.Count(s => s.Path.Contains(@"/Movies/Avatar (2009)/")).ShouldBe(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ using ErsatzTV.Scanner.Core.Interfaces.FFmpeg;
|
||||
using ErsatzTV.Scanner.Core.Interfaces.Metadata;
|
||||
using ErsatzTV.Scanner.Core.Metadata;
|
||||
using ErsatzTV.Scanner.Tests.Core.Fakes;
|
||||
using FluentAssertions;
|
||||
using Shouldly;
|
||||
using MediatR;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using NSubstitute;
|
||||
@@ -109,7 +109,7 @@ public class MovieFolderScannerTests
|
||||
1,
|
||||
CancellationToken.None);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
|
||||
await _movieRepository.Received(1).GetOrAdd(
|
||||
Arg.Any<LibraryPath>(),
|
||||
@@ -153,7 +153,7 @@ public class MovieFolderScannerTests
|
||||
1,
|
||||
CancellationToken.None);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
|
||||
await _movieRepository.Received(1).GetOrAdd(
|
||||
Arg.Any<LibraryPath>(),
|
||||
@@ -196,7 +196,7 @@ public class MovieFolderScannerTests
|
||||
1,
|
||||
CancellationToken.None);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
|
||||
await _movieRepository.Received(1).GetOrAdd(
|
||||
Arg.Any<LibraryPath>(),
|
||||
@@ -240,7 +240,7 @@ public class MovieFolderScannerTests
|
||||
1,
|
||||
CancellationToken.None);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
|
||||
await _movieRepository.Received(1).GetOrAdd(
|
||||
Arg.Any<LibraryPath>(),
|
||||
@@ -288,7 +288,7 @@ public class MovieFolderScannerTests
|
||||
1,
|
||||
CancellationToken.None);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
|
||||
await _movieRepository.Received(1).GetOrAdd(
|
||||
Arg.Any<LibraryPath>(),
|
||||
@@ -337,7 +337,7 @@ public class MovieFolderScannerTests
|
||||
1,
|
||||
CancellationToken.None);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
|
||||
await _movieRepository.Received(1).GetOrAdd(
|
||||
Arg.Any<LibraryPath>(),
|
||||
@@ -386,7 +386,7 @@ public class MovieFolderScannerTests
|
||||
1,
|
||||
CancellationToken.None);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
|
||||
await _movieRepository.Received(1).GetOrAdd(
|
||||
Arg.Any<LibraryPath>(),
|
||||
@@ -434,7 +434,7 @@ public class MovieFolderScannerTests
|
||||
1,
|
||||
CancellationToken.None);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
|
||||
await _movieRepository.Received(1).GetOrAdd(
|
||||
Arg.Any<LibraryPath>(),
|
||||
@@ -478,7 +478,7 @@ public class MovieFolderScannerTests
|
||||
1,
|
||||
CancellationToken.None);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
|
||||
await _movieRepository.Received(1).GetOrAdd(
|
||||
Arg.Any<LibraryPath>(),
|
||||
@@ -524,7 +524,7 @@ public class MovieFolderScannerTests
|
||||
1,
|
||||
CancellationToken.None);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
|
||||
await _movieRepository.Received(1).GetOrAdd(
|
||||
Arg.Any<LibraryPath>(),
|
||||
@@ -564,7 +564,7 @@ public class MovieFolderScannerTests
|
||||
1,
|
||||
CancellationToken.None);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
|
||||
await _movieRepository.Received(1).GetOrAdd(
|
||||
Arg.Any<LibraryPath>(),
|
||||
@@ -609,7 +609,7 @@ public class MovieFolderScannerTests
|
||||
1,
|
||||
CancellationToken.None);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
|
||||
await _mediaItemRepository.Received(1).FlagFileNotFound(Arg.Any<LibraryPath>(), Arg.Any<string>());
|
||||
await _mediaItemRepository.Received(1).FlagFileNotFound(libraryPath, oldMoviePath);
|
||||
@@ -638,7 +638,7 @@ public class MovieFolderScannerTests
|
||||
1,
|
||||
CancellationToken.None);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
|
||||
await _mediaItemRepository.Received(1).FlagFileNotFound(Arg.Any<LibraryPath>(), Arg.Any<string>());
|
||||
await _mediaItemRepository.Received(1).FlagFileNotFound(libraryPath, oldMoviePath);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Scanner.Core.Metadata.Nfo;
|
||||
using FluentAssertions;
|
||||
using Shouldly;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.IO;
|
||||
using NSubstitute;
|
||||
@@ -44,7 +44,7 @@ public class ArtistNfoReaderTests
|
||||
|
||||
Either<BaseError, ArtistNfo> result = await _artistNfoReader.Read(stream);
|
||||
|
||||
result.IsLeft.Should().BeTrue();
|
||||
result.IsLeft.ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -54,7 +54,7 @@ public class ArtistNfoReaderTests
|
||||
|
||||
Either<BaseError, ArtistNfo> result = await _artistNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -67,7 +67,7 @@ https://www.themoviedb.org/movie/11-star-wars"));
|
||||
|
||||
Either<BaseError, ArtistNfo> result = await _artistNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -121,14 +121,14 @@ https://www.themoviedb.org/movie/11-star-wars"));
|
||||
|
||||
Either<BaseError, ArtistNfo> result = await _artistNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
|
||||
foreach (ArtistNfo nfo in result.RightToSeq())
|
||||
{
|
||||
nfo.Name.Should().Be("Billy Joel");
|
||||
nfo.Disambiguation.Should().BeNullOrEmpty();
|
||||
nfo.Genres.Should().BeEquivalentTo(new List<string> { "Pop/Rock" });
|
||||
nfo.Styles.Should().BeEquivalentTo(
|
||||
nfo.Name.ShouldBe("Billy Joel");
|
||||
nfo.Disambiguation.ShouldBeNullOrEmpty();
|
||||
nfo.Genres.ShouldBeEquivalentTo(new List<string> { "Pop/Rock" });
|
||||
nfo.Styles.ShouldBeEquivalentTo(
|
||||
new List<string>
|
||||
{
|
||||
"Album Rock",
|
||||
@@ -137,7 +137,7 @@ https://www.themoviedb.org/movie/11-star-wars"));
|
||||
"Soft Rock",
|
||||
"Keyboard"
|
||||
});
|
||||
nfo.Moods.Should().BeEquivalentTo(
|
||||
nfo.Moods.ShouldBeEquivalentTo(
|
||||
new List<string>
|
||||
{
|
||||
"Amiable/Good-Natured",
|
||||
@@ -150,7 +150,7 @@ https://www.themoviedb.org/movie/11-star-wars"));
|
||||
"Cynical/Sarcastic",
|
||||
"Earnest"
|
||||
});
|
||||
nfo.Biography.Should().Be(
|
||||
nfo.Biography.ShouldBe(
|
||||
NormalizeLineEndingsLF(
|
||||
@"William Martin ""Billy"" Joel (born May 9, 1949, New York, USA) is an American pianist, singer-songwriter, and composer. Since releasing his first hit song, ""Piano Man"", in 1973, Joel has become the sixth-best-selling recording artist and the third-best-selling solo artist in the United States, according to the RIAA. His compilation album Greatest Hits Vol. 1 & 2 is the third-best-selling album in the United States by discs shipped.
|
||||
Joel had Top 40 hits in the 1970s, 1980s, and 1990s, achieving 33 Top 40 hits in the United States, all of which he wrote himself. He is also a six-time Grammy Award winner, a 23-time Grammy nominee and one of the world's best-selling artists of all time, having sold over 150 million records worldwide. He was inducted into the Songwriter's Hall of Fame (1992), the Rock and Roll Hall of Fame (1999), and the Long Island Music Hall of Fame (2006). In 2008, Billboard magazine released a list of the Hot 100 All-Time Top Artists to celebrate the US singles chart's 50th anniversary, with Billy Joel positioned at No. 23. With the exception of the 2007 songs ""All My Life"" and ""Christmas in Fallujah"", Joel stopped writing and recording popular music after 1993's River of Dreams, but he continued to tour extensively until 2010. Joel was born in the Bronx, May 9, 1949 and raised in Hicksville, New York in a Levitt home. His father, Howard (born Helmuth), was born in Germany, the son of German merchant and manufacturer Karl Amson Joel, who, after the advent of the Nazi regime, emigrated to Switzerland and later to the United States. Billy Joel's mother, Rosalind Nyman, was born in England to Philip and Rebecca Nyman. Both of Joel's parents were Jewish. They divorced in 1960, and his father moved to Vienna, Austria. Billy has a sister, Judith Joel, and a half-brother, Alexander Joel, who is an acclaimed classical conductor in Europe and currently chief musical director of the Staatstheater Braunschweig.
|
||||
@@ -167,10 +167,10 @@ Joel attended Hicksville High School in 1967, but he did not graduate with his c
|
||||
|
||||
Either<BaseError, ArtistNfo> result = await _artistNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
foreach (ArtistNfo nfo in result.RightToSeq())
|
||||
{
|
||||
nfo.Disambiguation.Should().Be("Test Disambiguation");
|
||||
nfo.Disambiguation.ShouldBe("Test Disambiguation");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -184,10 +184,10 @@ Joel attended Hicksville High School in 1967, but he did not graduate with his c
|
||||
"ArtistInvalidCharacters1.nfo");
|
||||
Either<BaseError, ArtistNfo> result = await _artistNfoReader.ReadFromFile(sourceFile);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
foreach (ArtistNfo nfo in result.RightToSeq())
|
||||
{
|
||||
nfo.Name.Should().Be("Test Name");
|
||||
nfo.Name.ShouldBe("Test Name");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -201,12 +201,12 @@ Joel attended Hicksville High School in 1967, but he did not graduate with his c
|
||||
"ArtistInvalidCharacters2.nfo");
|
||||
Either<BaseError, ArtistNfo> result = await _artistNfoReader.ReadFromFile(sourceFile);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
foreach (ArtistNfo nfo in result.RightToSeq())
|
||||
{
|
||||
nfo.Name.Should().Be("Test Name");
|
||||
nfo.Moods.Should().BeEquivalentTo(new List<string> { "Test Mood" });
|
||||
nfo.Styles.Count.Should().Be(1);
|
||||
nfo.Name.ShouldBe("Test Name");
|
||||
nfo.Moods.ShouldBeEquivalentTo(new List<string> { "Test Mood" });
|
||||
nfo.Styles.Count.ShouldBe(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Scanner.Core.Metadata.Nfo;
|
||||
using FluentAssertions;
|
||||
using Shouldly;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.IO;
|
||||
using NSubstitute;
|
||||
@@ -48,10 +48,10 @@ public class EpisodeNfoReaderTests
|
||||
|
||||
Either<BaseError, List<EpisodeNfo>> result = await _episodeNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
foreach (List<EpisodeNfo> list in result.RightToSeq())
|
||||
{
|
||||
list.Count.Should().Be(1);
|
||||
list.Count.ShouldBe(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,14 +77,14 @@ public class EpisodeNfoReaderTests
|
||||
|
||||
Either<BaseError, List<EpisodeNfo>> result = await _episodeNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
foreach (List<EpisodeNfo> list in result.RightToSeq())
|
||||
{
|
||||
list.Count.Should().Be(2);
|
||||
list.All(nfo => nfo.ShowTitle == "show").Should().BeTrue();
|
||||
list.All(nfo => nfo.Season == 1).Should().BeTrue();
|
||||
list.Count(nfo => nfo.Title == "episode-one" && nfo.Episode == 1).Should().Be(1);
|
||||
list.Count(nfo => nfo.Title == "episode-two" && nfo.Episode == 2).Should().Be(1);
|
||||
list.Count.ShouldBe(2);
|
||||
list.All(nfo => nfo.ShowTitle == "show").ShouldBeTrue();
|
||||
list.All(nfo => nfo.Season == 1).ShouldBeTrue();
|
||||
list.Count(nfo => nfo.Title == "episode-one" && nfo.Episode == 1).ShouldBe(1);
|
||||
list.Count(nfo => nfo.Title == "episode-two" && nfo.Episode == 2).ShouldBe(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,13 +102,13 @@ public class EpisodeNfoReaderTests
|
||||
|
||||
Either<BaseError, List<EpisodeNfo>> result = await _episodeNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
foreach (List<EpisodeNfo> list in result.RightToSeq())
|
||||
{
|
||||
list.Count.Should().Be(1);
|
||||
list[0].UniqueIds.Count.Should().Be(2);
|
||||
list[0].UniqueIds.Count(id => id.Default && id.Type == "tvdb" && id.Guid == "12345").Should().Be(1);
|
||||
list[0].UniqueIds.Count(id => !id.Default && id.Type == "imdb" && id.Guid == "tt54321").Should().Be(1);
|
||||
list.Count.ShouldBe(1);
|
||||
list[0].UniqueIds.Count.ShouldBe(2);
|
||||
list[0].UniqueIds.Count(id => id.Default && id.Type == "tvdb" && id.Guid == "12345").ShouldBe(1);
|
||||
list[0].UniqueIds.Count(id => !id.Default && id.Type == "imdb" && id.Guid == "tt54321").ShouldBe(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,11 +125,11 @@ public class EpisodeNfoReaderTests
|
||||
|
||||
Either<BaseError, List<EpisodeNfo>> result = await _episodeNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
foreach (List<EpisodeNfo> list in result.RightToSeq())
|
||||
{
|
||||
list.Count.Should().Be(1);
|
||||
list[0].ContentRating.Should().BeNullOrEmpty();
|
||||
list.Count.ShouldBe(1);
|
||||
list[0].ContentRating.ShouldBeNullOrEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,12 +149,12 @@ public class EpisodeNfoReaderTests
|
||||
|
||||
Either<BaseError, List<EpisodeNfo>> result = await _episodeNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
foreach (List<EpisodeNfo> list in result.RightToSeq())
|
||||
{
|
||||
list.Count.Should().Be(2);
|
||||
list.Count(nfo => nfo.ContentRating == "US:Something").Should().Be(1);
|
||||
list.Count(nfo => nfo.ContentRating == "US:Something / US:SomethingElse").Should().Be(1);
|
||||
list.Count.ShouldBe(2);
|
||||
list.Count(nfo => nfo.ContentRating == "US:Something").ShouldBe(1);
|
||||
list.Count(nfo => nfo.ContentRating == "US:Something / US:SomethingElse").ShouldBe(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,11 +171,11 @@ public class EpisodeNfoReaderTests
|
||||
|
||||
Either<BaseError, List<EpisodeNfo>> result = await _episodeNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
foreach (List<EpisodeNfo> list in result.RightToSeq())
|
||||
{
|
||||
list.Count.Should().Be(1);
|
||||
list[0].Plot.Should().BeNullOrEmpty();
|
||||
list.Count.ShouldBe(1);
|
||||
list[0].Plot.ShouldBeNullOrEmpty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,11 +192,11 @@ public class EpisodeNfoReaderTests
|
||||
|
||||
Either<BaseError, List<EpisodeNfo>> result = await _episodeNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
foreach (List<EpisodeNfo> list in result.RightToSeq())
|
||||
{
|
||||
list.Count.Should().Be(1);
|
||||
list[0].Plot.Should().Be("Some Plot");
|
||||
list.Count.ShouldBe(1);
|
||||
list[0].Plot.ShouldBe("Some Plot");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -222,15 +222,15 @@ public class EpisodeNfoReaderTests
|
||||
|
||||
Either<BaseError, List<EpisodeNfo>> result = await _episodeNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
foreach (List<EpisodeNfo> list in result.RightToSeq())
|
||||
{
|
||||
list.Count.Should().Be(1);
|
||||
list[0].Actors.Count.Should().Be(2);
|
||||
list.Count.ShouldBe(1);
|
||||
list[0].Actors.Count.ShouldBe(2);
|
||||
list[0].Actors.Count(a => a.Name == "Name 1" && a.Role == "Role 1" && a.Thumb == "Thumb 1")
|
||||
.Should().Be(1);
|
||||
.ShouldBe(1);
|
||||
list[0].Actors.Count(a => a.Name == "Name 2" && a.Role == "Role 2" && a.Thumb == "Thumb 2")
|
||||
.Should().Be(1);
|
||||
.ShouldBe(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -251,13 +251,13 @@ public class EpisodeNfoReaderTests
|
||||
|
||||
Either<BaseError, List<EpisodeNfo>> result = await _episodeNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
foreach (List<EpisodeNfo> list in result.RightToSeq())
|
||||
{
|
||||
list.Count.Should().Be(2);
|
||||
list.Count(nfo => nfo.Writers.Count == 1 && nfo.Writers[0] == "Writer 1").Should().Be(1);
|
||||
list.Count.ShouldBe(2);
|
||||
list.Count(nfo => nfo.Writers.Count == 1 && nfo.Writers[0] == "Writer 1").ShouldBe(1);
|
||||
list.Count(nfo => nfo.Writers.Count == 2 && nfo.Writers[0] == "Writer 2" && nfo.Writers[1] == "Writer 3")
|
||||
.Should().Be(1);
|
||||
.ShouldBe(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -278,15 +278,15 @@ public class EpisodeNfoReaderTests
|
||||
|
||||
Either<BaseError, List<EpisodeNfo>> result = await _episodeNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
foreach (List<EpisodeNfo> list in result.RightToSeq())
|
||||
{
|
||||
list.Count.Should().Be(2);
|
||||
list.Count(nfo => nfo.Directors.Count == 1 && nfo.Directors[0] == "Director 1").Should().Be(1);
|
||||
list.Count.ShouldBe(2);
|
||||
list.Count(nfo => nfo.Directors.Count == 1 && nfo.Directors[0] == "Director 1").ShouldBe(1);
|
||||
list.Count(
|
||||
nfo => nfo.Directors.Count == 2 && nfo.Directors[0] == "Director 2" &&
|
||||
nfo.Directors[1] == "Director 3")
|
||||
.Should().Be(1);
|
||||
.ShouldBe(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -307,12 +307,12 @@ public class EpisodeNfoReaderTests
|
||||
|
||||
Either<BaseError, List<EpisodeNfo>> result = await _episodeNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
foreach (List<EpisodeNfo> list in result.RightToSeq())
|
||||
{
|
||||
list.Count.Should().Be(2);
|
||||
list.Count(nfo => nfo.Genres is ["Genre 1"]).Should().Be(1);
|
||||
list.Count(nfo => nfo.Genres is ["Genre 2", "Genre 3"]).Should().Be(1);
|
||||
list.Count.ShouldBe(2);
|
||||
list.Count(nfo => nfo.Genres is ["Genre 1"]).ShouldBe(1);
|
||||
list.Count(nfo => nfo.Genres is ["Genre 2", "Genre 3"]).ShouldBe(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -333,12 +333,12 @@ public class EpisodeNfoReaderTests
|
||||
|
||||
Either<BaseError, List<EpisodeNfo>> result = await _episodeNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
foreach (List<EpisodeNfo> list in result.RightToSeq())
|
||||
{
|
||||
list.Count.Should().Be(2);
|
||||
list.Count(nfo => nfo.Tags is ["Tag 1"]).Should().Be(1);
|
||||
list.Count(nfo => nfo.Tags is ["Tag 2", "Tag 3"]).Should().Be(1);
|
||||
list.Count.ShouldBe(2);
|
||||
list.Count(nfo => nfo.Tags is ["Tag 1"]).ShouldBe(1);
|
||||
list.Count(nfo => nfo.Tags is ["Tag 2", "Tag 3"]).ShouldBe(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -434,25 +434,25 @@ public class EpisodeNfoReaderTests
|
||||
|
||||
Either<BaseError, List<EpisodeNfo>> result = await _episodeNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
|
||||
foreach (EpisodeNfo nfo in result.RightToSeq().Flatten())
|
||||
{
|
||||
nfo.ShowTitle.Should().Be("WandaVision");
|
||||
nfo.Title.Should().Be("Filmed Before a Live Studio Audience");
|
||||
nfo.Episode.Should().Be(1);
|
||||
nfo.Season.Should().Be(1);
|
||||
nfo.ContentRating.Should().Be("Australia:TV-14");
|
||||
nfo.ShowTitle.ShouldBe("WandaVision");
|
||||
nfo.Title.ShouldBe("Filmed Before a Live Studio Audience");
|
||||
nfo.Episode.ShouldBe(1);
|
||||
nfo.Season.ShouldBe(1);
|
||||
nfo.ContentRating.ShouldBe("Australia:TV-14");
|
||||
|
||||
nfo.Aired.IsSome.Should().BeTrue();
|
||||
nfo.Aired.IsSome.ShouldBeTrue();
|
||||
foreach (DateTime aired in nfo.Aired)
|
||||
{
|
||||
aired.Should().Be(new DateTime(2021, 01, 15));
|
||||
aired.ShouldBe(new DateTime(2021, 01, 15));
|
||||
}
|
||||
|
||||
nfo.Plot.Should().Be(
|
||||
nfo.Plot.ShouldBe(
|
||||
"Wanda and Vision struggle to conceal their powers during dinner with Vision’s boss and his wife.");
|
||||
nfo.Actors.Should().BeEquivalentTo(
|
||||
nfo.Actors.ShouldBeEquivalentTo(
|
||||
new List<ActorNfo>
|
||||
{
|
||||
new()
|
||||
@@ -466,9 +466,9 @@ public class EpisodeNfoReaderTests
|
||||
Thumb = "https://image.tmdb.org/t/p/original/rrfyo9z1wW5nY9ZsFlj1Ozfj9g2.jpg"
|
||||
}
|
||||
});
|
||||
nfo.Writers.Should().BeEquivalentTo(new List<string> { "Jac Schaeffer" });
|
||||
nfo.Directors.Should().BeEquivalentTo(new List<string> { "Matt Shakman" });
|
||||
nfo.UniqueIds.Should().BeEquivalentTo(
|
||||
nfo.Writers.ShouldBeEquivalentTo(new List<string> { "Jac Schaeffer" });
|
||||
nfo.Directors.ShouldBeEquivalentTo(new List<string> { "Matt Shakman" });
|
||||
nfo.UniqueIds.ShouldBeEquivalentTo(
|
||||
new List<UniqueIdNfo>
|
||||
{
|
||||
new() { Type = "imdb", Guid = "tt9601584", Default = false },
|
||||
@@ -488,11 +488,11 @@ public class EpisodeNfoReaderTests
|
||||
"EpisodeInvalidCharacters.nfo");
|
||||
Either<BaseError, List<EpisodeNfo>> result = await _episodeNfoReader.ReadFromFile(sourceFile);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
foreach (List<EpisodeNfo> list in result.RightToSeq())
|
||||
{
|
||||
list.Count.Should().Be(1);
|
||||
list[0].Title.Should().Be("Test Title");
|
||||
list.Count.ShouldBe(1);
|
||||
list[0].Title.ShouldBe("Test Title");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Scanner.Core.Metadata.Nfo;
|
||||
using FluentAssertions;
|
||||
using Shouldly;
|
||||
using Microsoft.Extensions.Logging.Abstractions;
|
||||
using Microsoft.IO;
|
||||
using NSubstitute;
|
||||
@@ -29,7 +29,7 @@ public class MovieNfoReaderTests
|
||||
|
||||
Either<BaseError, MovieNfo> result = await _movieNfoReader.Read(stream);
|
||||
|
||||
result.IsLeft.Should().BeTrue();
|
||||
result.IsLeft.ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -39,7 +39,7 @@ public class MovieNfoReaderTests
|
||||
|
||||
Either<BaseError, MovieNfo> result = await _movieNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -52,7 +52,7 @@ https://www.themoviedb.org/movie/11-star-wars"));
|
||||
|
||||
Either<BaseError, MovieNfo> result = await _movieNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -170,29 +170,29 @@ https://www.themoviedb.org/movie/11-star-wars"));
|
||||
|
||||
Either<BaseError, MovieNfo> result = await _movieNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
|
||||
foreach (MovieNfo nfo in result.RightToSeq())
|
||||
{
|
||||
nfo.Title.Should().Be("Zack Snyder's Justice League");
|
||||
nfo.SortTitle.Should().Be("Justice League 2");
|
||||
nfo.Outline.Should().BeNullOrEmpty();
|
||||
nfo.Year.Should().Be(2021);
|
||||
nfo.ContentRating.Should().Be("Australia:M");
|
||||
nfo.Title.ShouldBe("Zack Snyder's Justice League");
|
||||
nfo.SortTitle.ShouldBe("Justice League 2");
|
||||
nfo.Outline.ShouldBeNullOrEmpty();
|
||||
nfo.Year.ShouldBe(2021);
|
||||
nfo.ContentRating.ShouldBe("Australia:M");
|
||||
|
||||
nfo.Premiered.IsSome.Should().BeTrue();
|
||||
nfo.Premiered.IsSome.ShouldBeTrue();
|
||||
foreach (DateTime premiered in nfo.Premiered)
|
||||
{
|
||||
premiered.Should().Be(new DateTime(2021, 03, 18));
|
||||
premiered.ShouldBe(new DateTime(2021, 03, 18));
|
||||
}
|
||||
|
||||
nfo.Plot.Should().Be(
|
||||
nfo.Plot.ShouldBe(
|
||||
"Determined to ensure Superman's ultimate sacrifice was not in vain, Bruce Wayne aligns forces with Diana Prince with plans to recruit a team of metahumans to protect the world from an approaching threat of catastrophic proportions.");
|
||||
// nfo.Tagline.Should().BeNullOrEmpty();
|
||||
nfo.Genres.Should().BeEquivalentTo(new List<string> { "SuperHero" });
|
||||
nfo.Tags.Should().BeEquivalentTo(new List<string> { "TV Recording" });
|
||||
nfo.Studios.Should().BeEquivalentTo(new List<string> { "Warner Bros. Pictures" });
|
||||
nfo.Actors.Should().BeEquivalentTo(
|
||||
// nfo.Tagline.ShouldBeNullOrEmpty();
|
||||
nfo.Genres.ShouldBeEquivalentTo(new List<string> { "SuperHero" });
|
||||
nfo.Tags.ShouldBeEquivalentTo(new List<string> { "TV Recording" });
|
||||
nfo.Studios.ShouldBeEquivalentTo(new List<string> { "Warner Bros. Pictures" });
|
||||
nfo.Actors.ShouldBeEquivalentTo(
|
||||
new List<ActorNfo>
|
||||
{
|
||||
new()
|
||||
@@ -211,9 +211,9 @@ https://www.themoviedb.org/movie/11-star-wars"));
|
||||
Thumb = "https://image.tmdb.org/t/p/original/fysvehTvU6bE3JgxaOTRfvQJzJ4.jpg"
|
||||
}
|
||||
});
|
||||
nfo.Writers.Should().BeEquivalentTo(new List<string> { "Chris Terrio" });
|
||||
nfo.Directors.Should().BeEquivalentTo(new List<string> { "Zack Snyder" });
|
||||
nfo.UniqueIds.Should().BeEquivalentTo(
|
||||
nfo.Writers.ShouldBeEquivalentTo(new List<string> { "Chris Terrio" });
|
||||
nfo.Directors.ShouldBeEquivalentTo(new List<string> { "Zack Snyder" });
|
||||
nfo.UniqueIds.ShouldBeEquivalentTo(
|
||||
new List<UniqueIdNfo>
|
||||
{
|
||||
new() { Type = "imdb", Guid = "tt12361974", Default = false },
|
||||
@@ -229,10 +229,10 @@ https://www.themoviedb.org/movie/11-star-wars"));
|
||||
|
||||
Either<BaseError, MovieNfo> result = await _movieNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
foreach (MovieNfo nfo in result.RightToSeq())
|
||||
{
|
||||
nfo.Tags.Should().BeEquivalentTo(new List<string> { "Test Tag" });
|
||||
nfo.Tags.ShouldBeEquivalentTo(new List<string> { "Test Tag" });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,10 +244,10 @@ https://www.themoviedb.org/movie/11-star-wars"));
|
||||
|
||||
Either<BaseError, MovieNfo> result = await _movieNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
foreach (MovieNfo nfo in result.RightToSeq())
|
||||
{
|
||||
nfo.Outline.Should().Be("Test Outline");
|
||||
nfo.Outline.ShouldBe("Test Outline");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Scanner.Core.Metadata.Nfo;
|
||||
using FluentAssertions;
|
||||
using Shouldly;
|
||||
using Microsoft.Extensions.Logging.Abstractions;
|
||||
using Microsoft.IO;
|
||||
using NSubstitute;
|
||||
@@ -29,7 +29,7 @@ public class MusicVideoNfoReaderTests
|
||||
|
||||
Either<BaseError, MusicVideoNfo> result = await _musicVideoNfoReader.Read(stream);
|
||||
|
||||
result.IsLeft.Should().BeTrue();
|
||||
result.IsLeft.ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -39,7 +39,7 @@ public class MusicVideoNfoReaderTests
|
||||
|
||||
Either<BaseError, MusicVideoNfo> result = await _musicVideoNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -52,7 +52,7 @@ https://www.themoviedb.org/movie/11-star-wars"));
|
||||
|
||||
Either<BaseError, MusicVideoNfo> result = await _musicVideoNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -115,22 +115,22 @@ https://www.themoviedb.org/movie/11-star-wars"));
|
||||
|
||||
Either<BaseError, MusicVideoNfo> result = await _musicVideoNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
|
||||
foreach (MusicVideoNfo nfo in result.RightToSeq())
|
||||
{
|
||||
nfo.Artists.Should().BeEquivalentTo(new List<string> { "ABBA" });
|
||||
nfo.Title.Should().Be("Dancing Queen");
|
||||
nfo.Album.Should().Be("Arrival");
|
||||
nfo.Plot.Should().Be(
|
||||
nfo.Artists.ShouldBeEquivalentTo(new List<string> { "ABBA" });
|
||||
nfo.Title.ShouldBe("Dancing Queen");
|
||||
nfo.Album.ShouldBe("Arrival");
|
||||
nfo.Plot.ShouldBe(
|
||||
NormalizeLineEndingsLF(
|
||||
@"Dancing Queen est un des tubes emblématiques de l'ère disco produits par le groupe suédois ABBA en 1976. Ce tube connaît un regain de popularité en 1994 lors de la sortie de Priscilla, folle du désert, et fait « presque » partie de la distribution du film Muriel.
|
||||
Le groupe a également enregistré une version espagnole de ce titre, La reina del baile, pour le marché d'Amérique latine. On peut retrouver ces versions en espagnol des succès de ABBA sur l'abum Oro. Le 18 juin 1976, ABBA a interprété cette chanson lors d'un spectacle télévisé organisé en l'honneur du roi Charles XVI Gustave de Suède, qui venait de se marier. Le titre sera repris en 2011 par Glee dans la saison 2, épisode 20."));
|
||||
|
||||
nfo.Year.Should().Be(1976);
|
||||
nfo.Aired.IsNone.Should().BeTrue();
|
||||
nfo.Genres.Should().BeEquivalentTo(new List<string> { "Pop" });
|
||||
nfo.Track.Should().Be(-1);
|
||||
nfo.Year.ShouldBe(1976);
|
||||
nfo.Aired.IsNone.ShouldBeTrue();
|
||||
nfo.Genres.ShouldBeEquivalentTo(new List<string> { "Pop" });
|
||||
nfo.Track.ShouldBe(-1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,10 +142,10 @@ Le groupe a également enregistré une version espagnole de ce titre, La reina d
|
||||
|
||||
Either<BaseError, MusicVideoNfo> result = await _musicVideoNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
foreach (MusicVideoNfo nfo in result.RightToSeq())
|
||||
{
|
||||
nfo.Tags.Should().BeEquivalentTo(new List<string> { "Test Tag" });
|
||||
nfo.Tags.ShouldBeEquivalentTo(new List<string> { "Test Tag" });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,13 +157,13 @@ Le groupe a également enregistré une version espagnole de ce titre, La reina d
|
||||
|
||||
Either<BaseError, MusicVideoNfo> result = await _musicVideoNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
foreach (MusicVideoNfo nfo in result.RightToSeq())
|
||||
{
|
||||
nfo.Aired.IsSome.Should().BeTrue();
|
||||
nfo.Aired.IsSome.ShouldBeTrue();
|
||||
foreach (DateTime aired in nfo.Aired)
|
||||
{
|
||||
aired.Should().Be(new DateTime(2022, 02, 03));
|
||||
aired.ShouldBe(new DateTime(2022, 02, 03));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -176,10 +176,10 @@ Le groupe a également enregistré une version espagnole de ce titre, La reina d
|
||||
|
||||
Either<BaseError, MusicVideoNfo> result = await _musicVideoNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
foreach (MusicVideoNfo nfo in result.RightToSeq())
|
||||
{
|
||||
nfo.Studios.Should().BeEquivalentTo(new List<string> { "Test Studio" });
|
||||
nfo.Studios.ShouldBeEquivalentTo(new List<string> { "Test Studio" });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -191,10 +191,10 @@ Le groupe a également enregistré une version espagnole de ce titre, La reina d
|
||||
|
||||
Either<BaseError, MusicVideoNfo> result = await _musicVideoNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
foreach (MusicVideoNfo nfo in result.RightToSeq())
|
||||
{
|
||||
nfo.Directors.Should().BeEquivalentTo(new List<string> { "Test Director" });
|
||||
nfo.Directors.ShouldBeEquivalentTo(new List<string> { "Test Director" });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Scanner.Core.Metadata.Nfo;
|
||||
using FluentAssertions;
|
||||
using Shouldly;
|
||||
using Microsoft.Extensions.Logging.Abstractions;
|
||||
using Microsoft.IO;
|
||||
using NSubstitute;
|
||||
@@ -29,7 +29,7 @@ public class OtherVideoNfoReaderTests
|
||||
|
||||
Either<BaseError, OtherVideoNfo> result = await _otherVideoNfoReader.Read(stream);
|
||||
|
||||
result.IsLeft.Should().BeTrue();
|
||||
result.IsLeft.ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -39,7 +39,7 @@ public class OtherVideoNfoReaderTests
|
||||
|
||||
Either<BaseError, OtherVideoNfo> result = await _otherVideoNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -52,7 +52,7 @@ https://www.themoviedb.org/movie/11-star-wars"));
|
||||
|
||||
Either<BaseError, OtherVideoNfo> result = await _otherVideoNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -170,29 +170,29 @@ https://www.themoviedb.org/movie/11-star-wars"));
|
||||
|
||||
Either<BaseError, OtherVideoNfo> result = await _otherVideoNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
|
||||
foreach (OtherVideoNfo nfo in result.RightToSeq())
|
||||
{
|
||||
nfo.Title.Should().Be("Zack Snyder's Justice League");
|
||||
nfo.SortTitle.Should().Be("Justice League 2");
|
||||
nfo.Outline.Should().BeNullOrEmpty();
|
||||
nfo.Year.Should().Be(2021);
|
||||
nfo.ContentRating.Should().Be("Australia:M");
|
||||
nfo.Title.ShouldBe("Zack Snyder's Justice League");
|
||||
nfo.SortTitle.ShouldBe("Justice League 2");
|
||||
nfo.Outline.ShouldBeNullOrEmpty();
|
||||
nfo.Year.ShouldBe(2021);
|
||||
nfo.ContentRating.ShouldBe("Australia:M");
|
||||
|
||||
nfo.Premiered.IsSome.Should().BeTrue();
|
||||
nfo.Premiered.IsSome.ShouldBeTrue();
|
||||
foreach (DateTime premiered in nfo.Premiered)
|
||||
{
|
||||
premiered.Should().Be(new DateTime(2021, 03, 18));
|
||||
premiered.ShouldBe(new DateTime(2021, 03, 18));
|
||||
}
|
||||
|
||||
nfo.Plot.Should().Be(
|
||||
nfo.Plot.ShouldBe(
|
||||
"Determined to ensure Superman's ultimate sacrifice was not in vain, Bruce Wayne aligns forces with Diana Prince with plans to recruit a team of metahumans to protect the world from an approaching threat of catastrophic proportions.");
|
||||
nfo.Tagline.Should().BeNullOrEmpty();
|
||||
nfo.Genres.Should().BeEquivalentTo(new List<string> { "SuperHero" });
|
||||
nfo.Tags.Should().BeEquivalentTo(new List<string> { "TV Recording" });
|
||||
nfo.Studios.Should().BeEquivalentTo(new List<string> { "Warner Bros. Pictures" });
|
||||
nfo.Actors.Should().BeEquivalentTo(
|
||||
nfo.Tagline.ShouldBeNullOrEmpty();
|
||||
nfo.Genres.ShouldBeEquivalentTo(new List<string> { "SuperHero" });
|
||||
nfo.Tags.ShouldBeEquivalentTo(new List<string> { "TV Recording" });
|
||||
nfo.Studios.ShouldBeEquivalentTo(new List<string> { "Warner Bros. Pictures" });
|
||||
nfo.Actors.ShouldBeEquivalentTo(
|
||||
new List<ActorNfo>
|
||||
{
|
||||
new()
|
||||
@@ -211,9 +211,9 @@ https://www.themoviedb.org/movie/11-star-wars"));
|
||||
Thumb = "https://image.tmdb.org/t/p/original/fysvehTvU6bE3JgxaOTRfvQJzJ4.jpg"
|
||||
}
|
||||
});
|
||||
nfo.Writers.Should().BeEquivalentTo(new List<string> { "Chris Terrio" });
|
||||
nfo.Directors.Should().BeEquivalentTo(new List<string> { "Zack Snyder" });
|
||||
nfo.UniqueIds.Should().BeEquivalentTo(
|
||||
nfo.Writers.ShouldBeEquivalentTo(new List<string> { "Chris Terrio" });
|
||||
nfo.Directors.ShouldBeEquivalentTo(new List<string> { "Zack Snyder" });
|
||||
nfo.UniqueIds.ShouldBeEquivalentTo(
|
||||
new List<UniqueIdNfo>
|
||||
{
|
||||
new() { Type = "imdb", Guid = "tt12361974", Default = false },
|
||||
@@ -229,10 +229,10 @@ https://www.themoviedb.org/movie/11-star-wars"));
|
||||
|
||||
Either<BaseError, OtherVideoNfo> result = await _otherVideoNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
foreach (OtherVideoNfo nfo in result.RightToSeq())
|
||||
{
|
||||
nfo.Tags.Should().BeEquivalentTo(new List<string> { "Test Tag" });
|
||||
nfo.Tags.ShouldBeEquivalentTo(new List<string> { "Test Tag" });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,10 +244,10 @@ https://www.themoviedb.org/movie/11-star-wars"));
|
||||
|
||||
Either<BaseError, OtherVideoNfo> result = await _otherVideoNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
foreach (OtherVideoNfo nfo in result.RightToSeq())
|
||||
{
|
||||
nfo.Outline.Should().Be("Test Outline");
|
||||
nfo.Outline.ShouldBe("Test Outline");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
using Bugsnag;
|
||||
using ErsatzTV.Core;
|
||||
using ErsatzTV.Scanner.Core.Metadata.Nfo;
|
||||
using FluentAssertions;
|
||||
using Shouldly;
|
||||
using Microsoft.Extensions.Logging.Abstractions;
|
||||
using Microsoft.IO;
|
||||
using NSubstitute;
|
||||
@@ -29,7 +29,7 @@ public class ShowNfoReaderTests
|
||||
|
||||
Either<BaseError, ShowNfo> result = await _showNfoReader.Read(stream);
|
||||
|
||||
result.IsLeft.Should().BeTrue();
|
||||
result.IsLeft.ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -39,7 +39,7 @@ public class ShowNfoReaderTests
|
||||
|
||||
Either<BaseError, ShowNfo> result = await _showNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -52,7 +52,7 @@ https://www.themoviedb.org/movie/11-star-wars"));
|
||||
|
||||
Either<BaseError, ShowNfo> result = await _showNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -155,18 +155,18 @@ https://www.themoviedb.org/movie/11-star-wars"));
|
||||
|
||||
Either<BaseError, ShowNfo> result = await _showNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
|
||||
foreach (ShowNfo nfo in result.RightToSeq())
|
||||
{
|
||||
nfo.Title.Should().Be("WandaVision");
|
||||
nfo.Year.Should().Be(2021);
|
||||
nfo.Plot.Should().Be(
|
||||
nfo.Title.ShouldBe("WandaVision");
|
||||
nfo.Year.ShouldBe(2021);
|
||||
nfo.Plot.ShouldBe(
|
||||
"Wanda Maximoff and Vision—two super-powered beings living idealized suburban lives—begin to suspect that everything is not as it seems.");
|
||||
nfo.ContentRating.Should().Be("Australia:M");
|
||||
nfo.Genres.Should().BeEquivalentTo(new List<string> { "SuperHero" });
|
||||
nfo.Studios.Should().BeEquivalentTo(new List<string> { "Disney+" });
|
||||
nfo.Actors.Should().BeEquivalentTo(
|
||||
nfo.ContentRating.ShouldBe("Australia:M");
|
||||
nfo.Genres.ShouldBeEquivalentTo(new List<string> { "SuperHero" });
|
||||
nfo.Studios.ShouldBeEquivalentTo(new List<string> { "Disney+" });
|
||||
nfo.Actors.ShouldBeEquivalentTo(
|
||||
new List<ActorNfo>
|
||||
{
|
||||
new()
|
||||
@@ -180,17 +180,17 @@ https://www.themoviedb.org/movie/11-star-wars"));
|
||||
Thumb = "https://image.tmdb.org/t/p/original/vcAVrAOZrpqmi37qjFdztRAv1u9.jpg"
|
||||
}
|
||||
});
|
||||
nfo.UniqueIds.Should().BeEquivalentTo(
|
||||
nfo.UniqueIds.ShouldBeEquivalentTo(
|
||||
new List<UniqueIdNfo>
|
||||
{
|
||||
new() { Type = "imdb", Guid = "tt9140560", Default = false },
|
||||
new() { Type = "tmdb", Guid = "85271", Default = true },
|
||||
new() { Type = "tvdb", Guid = "362392", Default = false }
|
||||
});
|
||||
nfo.Premiered.IsSome.Should().BeTrue();
|
||||
nfo.Premiered.IsSome.ShouldBeTrue();
|
||||
foreach (DateTime premiered in nfo.Premiered)
|
||||
{
|
||||
premiered.Should().Be(new DateTime(2021, 1, 15));
|
||||
premiered.ShouldBe(new DateTime(2021, 1, 15));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -203,10 +203,10 @@ https://www.themoviedb.org/movie/11-star-wars"));
|
||||
|
||||
Either<BaseError, ShowNfo> result = await _showNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
foreach (ShowNfo nfo in result.RightToSeq())
|
||||
{
|
||||
nfo.Outline.Should().Be("Test Outline");
|
||||
nfo.Outline.ShouldBe("Test Outline");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,10 +218,10 @@ https://www.themoviedb.org/movie/11-star-wars"));
|
||||
|
||||
Either<BaseError, ShowNfo> result = await _showNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
foreach (ShowNfo nfo in result.RightToSeq())
|
||||
{
|
||||
nfo.Tagline.Should().Be("Test Tagline");
|
||||
nfo.Tagline.ShouldBe("Test Tagline");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,10 +232,10 @@ https://www.themoviedb.org/movie/11-star-wars"));
|
||||
|
||||
Either<BaseError, ShowNfo> result = await _showNfoReader.Read(stream);
|
||||
|
||||
result.IsRight.Should().BeTrue();
|
||||
result.IsRight.ShouldBeTrue();
|
||||
foreach (ShowNfo nfo in result.RightToSeq())
|
||||
{
|
||||
nfo.Tags.Should().BeEquivalentTo(new List<string> { "Test Tag" });
|
||||
nfo.Tags.ShouldBeEquivalentTo(new List<string> { "Test Tag" });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="FluentAssertions" Version="8.2.0" />
|
||||
<PackageReference Include="LanguageExt.Core" Version="4.4.9" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
|
||||
<PackageReference Include="NSubstitute" Version="5.3.0" />
|
||||
@@ -23,6 +22,7 @@
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Shouldly" Version="4.3.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -53,4 +53,10 @@
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="Resources\song_album_cover_512.png">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 167 KiB |
Reference in New Issue
Block a user