f8b7c62f9e
Added Jellyfin.Database.Providers.Postgres project and integrated Npgsql packages for PostgreSQL support. Updated solution and test project references. Refactored code for clarity and performance, including improved string handling, log formatting, and plugin management. Enhanced .editorconfig rules and fixed minor test issues. Added publishing profiles and updated web server setup references. Cleaned up assembly info and cache files. Now able to successfully build solution
58 lines
1.8 KiB
C#
58 lines
1.8 KiB
C#
// <copyright file="StubTests.cs" company="PlaceholderCompany">
|
|
// Copyright (c) PlaceholderCompany. All rights reserved.
|
|
// </copyright>
|
|
|
|
namespace Jellyfin.Naming.Tests.Video
|
|
{
|
|
using Emby.Naming.Common;
|
|
using Emby.Naming.Video;
|
|
using Xunit;
|
|
|
|
public class StubTests
|
|
{
|
|
private readonly NamingOptions _namingOptions = new NamingOptions();
|
|
|
|
[Fact]
|
|
public void TestStubs()
|
|
{
|
|
Test("video.mkv", false, null);
|
|
Test("video.disc", true, null);
|
|
Test("video.dvd.disc", true, "dvd");
|
|
Test("video.hddvd.disc", true, "hddvd");
|
|
Test("video.bluray.disc", true, "bluray");
|
|
Test("video.brrip.disc", true, "bluray");
|
|
Test("video.bd25.disc", true, "bluray");
|
|
Test("video.bd50.disc", true, "bluray");
|
|
Test("video.vhs.disc", true, "vhs");
|
|
Test("video.hdtv.disc", true, "tv");
|
|
Test("video.pdtv.disc", true, "tv");
|
|
Test("video.dsr.disc", true, "tv");
|
|
Test(string.Empty, false, "tv");
|
|
}
|
|
|
|
[Fact]
|
|
public void TestStubName()
|
|
{
|
|
var result = VideoResolver.ResolveFile("C:/Users/media/Desktop/Video Test/Movies/Oblivion/Oblivion.dvd.disc", _namingOptions);
|
|
|
|
Assert.Equal("Oblivion", result?.Name);
|
|
}
|
|
|
|
private void Test(string path, bool isStub, string? stubType)
|
|
{
|
|
var isStubResult = StubResolver.TryResolveFile(path, _namingOptions, out var stubTypeResult);
|
|
|
|
Assert.Equal(isStub, isStubResult);
|
|
|
|
if (isStub)
|
|
{
|
|
Assert.Equal(stubType, stubTypeResult);
|
|
}
|
|
else
|
|
{
|
|
Assert.Null(stubTypeResult);
|
|
}
|
|
}
|
|
}
|
|
}
|