2019-12-06 20:40:06 +01:00
|
|
|
|
using Emby.Naming.Common;
|
|
|
|
|
using Emby.Naming.TV;
|
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
|
|
namespace Jellyfin.Naming.Tests.TV
|
|
|
|
|
{
|
|
|
|
|
public class DailyEpisodeTests
|
|
|
|
|
{
|
2022-01-04 17:59:30 +01:00
|
|
|
|
private readonly EpisodeResolver _resolver = new EpisodeResolver(new NamingOptions());
|
|
|
|
|
|
2020-02-27 03:31:57 +01:00
|
|
|
|
[Theory]
|
|
|
|
|
[InlineData(@"/server/anything_1996.11.14.mp4", "anything", 1996, 11, 14)]
|
|
|
|
|
[InlineData(@"/server/anything_1996-11-14.mp4", "anything", 1996, 11, 14)]
|
|
|
|
|
[InlineData(@"/server/james.corden.2017.04.20.anne.hathaway.720p.hdtv.x264-crooks.mkv", "james.corden", 2017, 04, 20)]
|
|
|
|
|
[InlineData(@"/server/ABC News 2018_03_24_19_00_00.mkv", "ABC News", 2018, 03, 24)]
|
2023-07-28 22:06:55 +02:00
|
|
|
|
[InlineData(@"/server/Jeopardy 2023 07 14 HDTV x264 AC3.mkv", "Jeopardy", 2023, 07, 14)]
|
2020-02-27 03:31:57 +01:00
|
|
|
|
// TODO: [InlineData(@"/server/anything_14.11.1996.mp4", "anything", 1996, 11, 14)]
|
|
|
|
|
// TODO: [InlineData(@"/server/A Daily Show - (2015-01-15) - Episode Name - [720p].mkv", "A Daily Show", 2015, 01, 15)]
|
|
|
|
|
// TODO: [InlineData(@"/server/Last Man Standing_KTLADT_2018_05_25_01_28_00.wtv", "Last Man Standing", 2018, 05, 25)]
|
|
|
|
|
public void Test(string path, string seriesName, int? year, int? month, int? day)
|
2019-12-06 20:40:06 +01:00
|
|
|
|
{
|
2022-01-04 17:59:30 +01:00
|
|
|
|
var result = _resolver.Resolve(path, false);
|
2019-12-06 20:40:06 +01:00
|
|
|
|
|
2020-05-14 00:59:19 +02:00
|
|
|
|
Assert.Null(result?.SeasonNumber);
|
|
|
|
|
Assert.Null(result?.EpisodeNumber);
|
|
|
|
|
Assert.Equal(year, result?.Year);
|
|
|
|
|
Assert.Equal(month, result?.Month);
|
|
|
|
|
Assert.Equal(day, result?.Day);
|
|
|
|
|
Assert.Equal(seriesName, result?.SeriesName, true);
|
2019-12-06 20:40:06 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|