Remove redundant verbatim string prefixes

This commit is contained in:
Stepan Goremykin 2023-10-08 00:15:38 +02:00
parent 508c48a8ba
commit 0870af330d
21 changed files with 306 additions and 306 deletions

View File

@ -318,7 +318,7 @@ namespace Emby.Naming.Common
new EpisodeExpression(@"[\._ -]()[Ee][Pp]_?([0-9]+)([^\\/]*)$"), new EpisodeExpression(@"[\._ -]()[Ee][Pp]_?([0-9]+)([^\\/]*)$"),
// <!-- foo.E01., foo.e01. --> // <!-- foo.E01., foo.e01. -->
new EpisodeExpression(@"[^\\/]*?()\.?[Ee]([0-9]+)\.([^\\/]*)$"), new EpisodeExpression(@"[^\\/]*?()\.?[Ee]([0-9]+)\.([^\\/]*)$"),
new EpisodeExpression(@"(?<year>[0-9]{4})[._ -](?<month>[0-9]{2})[._ -](?<day>[0-9]{2})", true) new EpisodeExpression("(?<year>[0-9]{4})[._ -](?<month>[0-9]{2})[._ -](?<day>[0-9]{2})", true)
{ {
DateTimeFormats = new[] DateTimeFormats = new[]
{ {
@ -328,7 +328,7 @@ namespace Emby.Naming.Common
"yyyy MM dd" "yyyy MM dd"
} }
}, },
new EpisodeExpression(@"(?<day>[0-9]{2})[._ -](?<month>[0-9]{2})[._ -](?<year>[0-9]{4})", true) new EpisodeExpression("(?<day>[0-9]{2})[._ -](?<month>[0-9]{2})[._ -](?<year>[0-9]{4})", true)
{ {
DateTimeFormats = new[] DateTimeFormats = new[]
{ {
@ -417,7 +417,7 @@ namespace Emby.Naming.Common
}, },
// "1-12 episode title" // "1-12 episode title"
new EpisodeExpression(@"([0-9]+)-([0-9]+)"), new EpisodeExpression("([0-9]+)-([0-9]+)"),
// "01 - blah.avi", "01-blah.avi" // "01 - blah.avi", "01-blah.avi"
new EpisodeExpression(@".*(\\|\/)(?<epnumber>[0-9]{1,3})(-(?<endingepnumber>[0-9]{2,3}))*\s?-\s?[^\\\/]*$") new EpisodeExpression(@".*(\\|\/)(?<epnumber>[0-9]{1,3})(-(?<endingepnumber>[0-9]{2,3}))*\s?-\s?[^\\\/]*$")
@ -712,7 +712,7 @@ namespace Emby.Naming.Common
// Chapter is often beginning of filename // Chapter is often beginning of filename
"^(?<chapter>[0-9]+)", "^(?<chapter>[0-9]+)",
// Part if often ending of filename // Part if often ending of filename
@"(?<!ch(?:apter) )(?<part>[0-9]+)$", "(?<!ch(?:apter) )(?<part>[0-9]+)$",
// Sometimes named as 0001_005 (chapter_part) // Sometimes named as 0001_005 (chapter_part)
"(?<chapter>[0-9]+)_(?<part>[0-9]+)", "(?<chapter>[0-9]+)_(?<part>[0-9]+)",
// Some audiobooks are ripped from cd's, and will be named by disk number. // Some audiobooks are ripped from cd's, and will be named by disk number.

View File

@ -177,7 +177,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
if (_ffmpegPath is not null) if (_ffmpegPath is not null)
{ {
// Determine a probe path from the mpeg path // Determine a probe path from the mpeg path
_ffprobePath = FfprobePathRegex().Replace(_ffmpegPath, @"ffprobe$1"); _ffprobePath = FfprobePathRegex().Replace(_ffmpegPath, "ffprobe$1");
// Interrogate to understand what coders are supported // Interrogate to understand what coders are supported
var validator = new EncoderValidator(_logger, _ffmpegPath); var validator = new EncoderValidator(_logger, _ffmpegPath);

View File

@ -159,7 +159,7 @@ namespace MediaBrowser.XbmcMetadata.Parsers
// Find last closing Tag // Find last closing Tag
// Need to do this in two steps to account for random > characters after the closing xml // Need to do this in two steps to account for random > characters after the closing xml
var index = xml.LastIndexOf(@"</", StringComparison.Ordinal); var index = xml.LastIndexOf("</", StringComparison.Ordinal);
// If closing tag exists, move to end of Tag // If closing tag exists, move to end of Tag
if (index != -1) if (index != -1)

View File

@ -14,18 +14,18 @@ namespace Jellyfin.Naming.Tests.AudioBook
data.Add( data.Add(
new AudioBookFileInfo( new AudioBookFileInfo(
@"/server/AudioBooks/Larry Potter/Larry Potter.mp3", "/server/AudioBooks/Larry Potter/Larry Potter.mp3",
"mp3")); "mp3"));
data.Add( data.Add(
new AudioBookFileInfo( new AudioBookFileInfo(
@"/server/AudioBooks/Berry Potter/Chapter 1 .ogg", "/server/AudioBooks/Berry Potter/Chapter 1 .ogg",
"ogg", "ogg",
chapterNumber: 1)); chapterNumber: 1));
data.Add( data.Add(
new AudioBookFileInfo( new AudioBookFileInfo(
@"/server/AudioBooks/Nerry Potter/Part 3 - Chapter 2.mp3", "/server/AudioBooks/Nerry Potter/Part 3 - Chapter 2.mp3",
"mp3", "mp3",
chapterNumber: 2, chapterNumber: 2,
partNumber: 3)); partNumber: 3));
@ -49,7 +49,7 @@ namespace Jellyfin.Naming.Tests.AudioBook
[Fact] [Fact]
public void Resolve_InvalidExtension() public void Resolve_InvalidExtension()
{ {
var result = new AudioBookResolver(_namingOptions).Resolve(@"/server/AudioBooks/Larry Potter/Larry Potter.mp9"); var result = new AudioBookResolver(_namingOptions).Resolve("/server/AudioBooks/Larry Potter/Larry Potter.mp9");
Assert.Null(result); Assert.Null(result);
} }

View File

@ -20,11 +20,11 @@ public class ExternalPathParserTests
var hindiCultureDto = new CultureDto("Hindi", "Hindi", "hi", new[] { "hin" }); var hindiCultureDto = new CultureDto("Hindi", "Hindi", "hi", new[] { "hin" });
var localizationManager = new Mock<ILocalizationManager>(MockBehavior.Loose); var localizationManager = new Mock<ILocalizationManager>(MockBehavior.Loose);
localizationManager.Setup(lm => lm.FindLanguageInfo(It.IsRegex(@"en.*", RegexOptions.IgnoreCase))) localizationManager.Setup(lm => lm.FindLanguageInfo(It.IsRegex("en.*", RegexOptions.IgnoreCase)))
.Returns(englishCultureDto); .Returns(englishCultureDto);
localizationManager.Setup(lm => lm.FindLanguageInfo(It.IsRegex(@"fr.*", RegexOptions.IgnoreCase))) localizationManager.Setup(lm => lm.FindLanguageInfo(It.IsRegex("fr.*", RegexOptions.IgnoreCase)))
.Returns(frenchCultureDto); .Returns(frenchCultureDto);
localizationManager.Setup(lm => lm.FindLanguageInfo(It.IsRegex(@"hi.*", RegexOptions.IgnoreCase))) localizationManager.Setup(lm => lm.FindLanguageInfo(It.IsRegex("hi.*", RegexOptions.IgnoreCase)))
.Returns(hindiCultureDto); .Returns(hindiCultureDto);
_audioPathParser = new ExternalPathParser(new NamingOptions(), localizationManager.Object, DlnaProfileType.Audio); _audioPathParser = new ExternalPathParser(new NamingOptions(), localizationManager.Object, DlnaProfileType.Audio);

View File

@ -12,34 +12,34 @@ namespace Jellyfin.Naming.Tests.Music
[InlineData("", false)] [InlineData("", false)]
[InlineData("C:/", false)] [InlineData("C:/", false)]
[InlineData("/home/", false)] [InlineData("/home/", false)]
[InlineData(@"blah blah", false)] [InlineData("blah blah", false)]
[InlineData(@"D:/music/weezer/03 Pinkerton", false)] [InlineData("D:/music/weezer/03 Pinkerton", false)]
[InlineData(@"D:/music/michael jackson/Bad (2012 Remaster)", false)] [InlineData("D:/music/michael jackson/Bad (2012 Remaster)", false)]
[InlineData(@"cd1", true)] [InlineData("cd1", true)]
[InlineData(@"disc18", true)] [InlineData("disc18", true)]
[InlineData(@"disk10", true)] [InlineData("disk10", true)]
[InlineData(@"vol7", true)] [InlineData("vol7", true)]
[InlineData(@"volume1", true)] [InlineData("volume1", true)]
[InlineData(@"cd 1", true)] [InlineData("cd 1", true)]
[InlineData(@"disc 1", true)] [InlineData("disc 1", true)]
[InlineData(@"disk 1", true)] [InlineData("disk 1", true)]
[InlineData(@"disk", false)] [InlineData("disk", false)]
[InlineData(@"disk ·", false)] [InlineData("disk ·", false)]
[InlineData(@"disk a", false)] [InlineData("disk a", false)]
[InlineData(@"disk volume", false)] [InlineData("disk volume", false)]
[InlineData(@"disc disc", false)] [InlineData("disc disc", false)]
[InlineData(@"disk disc 6", false)] [InlineData("disk disc 6", false)]
[InlineData(@"cd - 1", true)] [InlineData("cd - 1", true)]
[InlineData(@"disc- 1", true)] [InlineData("disc- 1", true)]
[InlineData(@"disk - 1", true)] [InlineData("disk - 1", true)]
[InlineData(@"Disc 01 (Hugo Wolf · 24 Lieder)", true)] [InlineData("Disc 01 (Hugo Wolf · 24 Lieder)", true)]
[InlineData(@"Disc 04 (Encores and Folk Songs)", true)] [InlineData("Disc 04 (Encores and Folk Songs)", true)]
[InlineData(@"Disc04 (Encores and Folk Songs)", true)] [InlineData("Disc04 (Encores and Folk Songs)", true)]
[InlineData(@"Disc 04(Encores and Folk Songs)", true)] [InlineData("Disc 04(Encores and Folk Songs)", true)]
[InlineData(@"Disc04(Encores and Folk Songs)", true)] [InlineData("Disc04(Encores and Folk Songs)", true)]
[InlineData(@"D:/Video/MBTestLibrary/VideoTest/music/.38 special/anth/Disc 2", true)] [InlineData("D:/Video/MBTestLibrary/VideoTest/music/.38 special/anth/Disc 2", true)]
[InlineData(@"[1985] Opportunities (Let's make lots of money) (1985)", false)] [InlineData("[1985] Opportunities (Let's make lots of money) (1985)", false)]
[InlineData(@"Blah 04(Encores and Folk Songs)", false)] [InlineData("Blah 04(Encores and Folk Songs)", false)]
public void AlbumParser_MultidiscPath_Identifies(string path, bool result) public void AlbumParser_MultidiscPath_Identifies(string path, bool result)
{ {
var parser = new AlbumParser(_namingOptions); var parser = new AlbumParser(_namingOptions);

View File

@ -9,11 +9,11 @@ namespace Jellyfin.Naming.Tests.TV
private readonly EpisodeResolver _resolver = new EpisodeResolver(new NamingOptions()); private readonly EpisodeResolver _resolver = new EpisodeResolver(new NamingOptions());
[Theory] [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/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/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)] [InlineData("/server/ABC News 2018_03_24_19_00_00.mkv", "ABC News", 2018, 03, 24)]
[InlineData(@"/server/Jeopardy 2023 07 14 HDTV x264 AC3.mkv", "Jeopardy", 2023, 07, 14)] [InlineData("/server/Jeopardy 2023 07 14 HDTV x264 AC3.mkv", "Jeopardy", 2023, 07, 14)]
// TODO: [InlineData(@"/server/anything_14.11.1996.mp4", "anything", 1996, 11, 14)] // 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/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)] // TODO: [InlineData(@"/server/Last Man Standing_KTLADT_2018_05_25_01_28_00.wtv", "Last Man Standing", 2018, 05, 25)]

View File

@ -9,16 +9,16 @@ namespace Jellyfin.Naming.Tests.TV
private readonly EpisodeResolver _resolver = new EpisodeResolver(new NamingOptions()); private readonly EpisodeResolver _resolver = new EpisodeResolver(new NamingOptions());
[Theory] [Theory]
[InlineData(8, @"The Simpsons/The Simpsons.S25E08.Steal this episode.mp4")] [InlineData(8, "The Simpsons/The Simpsons.S25E08.Steal this episode.mp4")]
[InlineData(2, @"The Simpsons/The Simpsons - 02 - Ep Name.avi")] [InlineData(2, "The Simpsons/The Simpsons - 02 - Ep Name.avi")]
[InlineData(2, @"The Simpsons/02.avi")] [InlineData(2, "The Simpsons/02.avi")]
[InlineData(2, @"The Simpsons/02 - Ep Name.avi")] [InlineData(2, "The Simpsons/02 - Ep Name.avi")]
[InlineData(2, @"The Simpsons/02-Ep Name.avi")] [InlineData(2, "The Simpsons/02-Ep Name.avi")]
[InlineData(2, @"The Simpsons/02.EpName.avi")] [InlineData(2, "The Simpsons/02.EpName.avi")]
[InlineData(2, @"The Simpsons/The Simpsons - 02.avi")] [InlineData(2, "The Simpsons/The Simpsons - 02.avi")]
[InlineData(2, @"The Simpsons/The Simpsons - 02 Ep Name.avi")] [InlineData(2, "The Simpsons/The Simpsons - 02 Ep Name.avi")]
[InlineData(7, @"GJ Club (2013)/GJ Club - 07.mkv")] [InlineData(7, "GJ Club (2013)/GJ Club - 07.mkv")]
[InlineData(17, @"Case Closed (1996-2007)/Case Closed - 317.mkv")] [InlineData(17, "Case Closed (1996-2007)/Case Closed - 317.mkv")]
// TODO: [InlineData(2, @"The Simpsons/The Simpsons 5 - 02 - Ep Name.avi")] // TODO: [InlineData(2, @"The Simpsons/The Simpsons 5 - 02 - Ep Name.avi")]
// TODO: [InlineData(2, @"The Simpsons/The Simpsons 5 - 02 Ep Name.avi")] // TODO: [InlineData(2, @"The Simpsons/The Simpsons 5 - 02 Ep Name.avi")]
// TODO: [InlineData(7, @"Seinfeld/Seinfeld 0807 The Checks.avi")] // TODO: [InlineData(7, @"Seinfeld/Seinfeld 0807 The Checks.avi")]

View File

@ -9,66 +9,66 @@ namespace Jellyfin.Naming.Tests.TV
private readonly EpisodePathParser _episodePathParser = new EpisodePathParser(new NamingOptions()); private readonly EpisodePathParser _episodePathParser = new EpisodePathParser(new NamingOptions());
[Theory] [Theory]
[InlineData(@"Season 1/4x01 20 Hours in America (1).mkv", null)] [InlineData("Season 1/4x01 20 Hours in America (1).mkv", null)]
[InlineData(@"Season 1/01x02 blah.avi", null)] [InlineData("Season 1/01x02 blah.avi", null)]
[InlineData(@"Season 1/S01x02 blah.avi", null)] [InlineData("Season 1/S01x02 blah.avi", null)]
[InlineData(@"Season 1/S01E02 blah.avi", null)] [InlineData("Season 1/S01E02 blah.avi", null)]
[InlineData(@"Season 1/S01xE02 blah.avi", null)] [InlineData("Season 1/S01xE02 blah.avi", null)]
[InlineData(@"Season 1/seriesname 01x02 blah.avi", null)] [InlineData("Season 1/seriesname 01x02 blah.avi", null)]
[InlineData(@"Season 1/seriesname S01x02 blah.avi", null)] [InlineData("Season 1/seriesname S01x02 blah.avi", null)]
[InlineData(@"Season 1/seriesname S01E02 blah.avi", null)] [InlineData("Season 1/seriesname S01E02 blah.avi", null)]
[InlineData(@"Season 1/seriesname S01xE02 blah.avi", null)] [InlineData("Season 1/seriesname S01xE02 blah.avi", null)]
[InlineData(@"Season 2/02x03 - 04 Ep Name.mp4", null)] [InlineData("Season 2/02x03 - 04 Ep Name.mp4", null)]
[InlineData(@"Season 2/My show name 02x03 - 04 Ep Name.mp4", null)] [InlineData("Season 2/My show name 02x03 - 04 Ep Name.mp4", null)]
[InlineData(@"Season 2/Elementary - 02x03 - 02x04 - 02x15 - Ep Name.mp4", 15)] [InlineData("Season 2/Elementary - 02x03 - 02x04 - 02x15 - Ep Name.mp4", 15)]
[InlineData(@"Season 2/02x03 - 02x04 - 02x15 - Ep Name.mp4", 15)] [InlineData("Season 2/02x03 - 02x04 - 02x15 - Ep Name.mp4", 15)]
[InlineData(@"Season 2/02x03-04-15 - Ep Name.mp4", 15)] [InlineData("Season 2/02x03-04-15 - Ep Name.mp4", 15)]
[InlineData(@"Season 2/Elementary - 02x03-04-15 - Ep Name.mp4", 15)] [InlineData("Season 2/Elementary - 02x03-04-15 - Ep Name.mp4", 15)]
[InlineData(@"Season 02/02x03-E15 - Ep Name.mp4", 15)] [InlineData("Season 02/02x03-E15 - Ep Name.mp4", 15)]
[InlineData(@"Season 02/Elementary - 02x03-E15 - Ep Name.mp4", 15)] [InlineData("Season 02/Elementary - 02x03-E15 - Ep Name.mp4", 15)]
[InlineData(@"Season 02/02x03 - x04 - x15 - Ep Name.mp4", 15)] [InlineData("Season 02/02x03 - x04 - x15 - Ep Name.mp4", 15)]
[InlineData(@"Season 02/Elementary - 02x03 - x04 - x15 - Ep Name.mp4", 15)] [InlineData("Season 02/Elementary - 02x03 - x04 - x15 - Ep Name.mp4", 15)]
[InlineData(@"Season 02/02x03x04x15 - Ep Name.mp4", 15)] [InlineData("Season 02/02x03x04x15 - Ep Name.mp4", 15)]
[InlineData(@"Season 02/Elementary - 02x03x04x15 - Ep Name.mp4", 15)] [InlineData("Season 02/Elementary - 02x03x04x15 - Ep Name.mp4", 15)]
[InlineData(@"Season 1/Elementary - S01E23-E24-E26 - The Woman.mp4", 26)] [InlineData("Season 1/Elementary - S01E23-E24-E26 - The Woman.mp4", 26)]
[InlineData(@"Season 1/S01E23-E24-E26 - The Woman.mp4", 26)] [InlineData("Season 1/S01E23-E24-E26 - The Woman.mp4", 26)]
// Four Digits seasons // Four Digits seasons
[InlineData(@"Season 2009/2009x02 blah.avi", null)] [InlineData("Season 2009/2009x02 blah.avi", null)]
[InlineData(@"Season 2009/S2009x02 blah.avi", null)] [InlineData("Season 2009/S2009x02 blah.avi", null)]
[InlineData(@"Season 2009/S2009E02 blah.avi", null)] [InlineData("Season 2009/S2009E02 blah.avi", null)]
[InlineData(@"Season 2009/S2009xE02 blah.avi", null)] [InlineData("Season 2009/S2009xE02 blah.avi", null)]
[InlineData(@"Season 2009/seriesname 2009x02 blah.avi", null)] [InlineData("Season 2009/seriesname 2009x02 blah.avi", null)]
[InlineData(@"Season 2009/seriesname S2009x02 blah.avi", null)] [InlineData("Season 2009/seriesname S2009x02 blah.avi", null)]
[InlineData(@"Season 2009/seriesname S2009E02 blah.avi", null)] [InlineData("Season 2009/seriesname S2009E02 blah.avi", null)]
[InlineData(@"Season 2009/seriesname S2009xE02 blah.avi", null)] [InlineData("Season 2009/seriesname S2009xE02 blah.avi", null)]
[InlineData(@"Season 2009/Elementary - 2009x03 - 2009x04 - 2009x15 - Ep Name.mp4", 15)] [InlineData("Season 2009/Elementary - 2009x03 - 2009x04 - 2009x15 - Ep Name.mp4", 15)]
[InlineData(@"Season 2009/2009x03 - 2009x04 - 2009x15 - Ep Name.mp4", 15)] [InlineData("Season 2009/2009x03 - 2009x04 - 2009x15 - Ep Name.mp4", 15)]
[InlineData(@"Season 2009/2009x03-04-15 - Ep Name.mp4", 15)] [InlineData("Season 2009/2009x03-04-15 - Ep Name.mp4", 15)]
[InlineData(@"Season 2009/Elementary - 2009x03-04-15 - Ep Name.mp4", 15)] [InlineData("Season 2009/Elementary - 2009x03-04-15 - Ep Name.mp4", 15)]
[InlineData(@"Season 2009/2009x03-E15 - Ep Name.mp4", 15)] [InlineData("Season 2009/2009x03-E15 - Ep Name.mp4", 15)]
[InlineData(@"Season 2009/Elementary - 2009x03-E15 - Ep Name.mp4", 15)] [InlineData("Season 2009/Elementary - 2009x03-E15 - Ep Name.mp4", 15)]
[InlineData(@"Season 2009/2009x03 - x04 - x15 - Ep Name.mp4", 15)] [InlineData("Season 2009/2009x03 - x04 - x15 - Ep Name.mp4", 15)]
[InlineData(@"Season 2009/Elementary - 2009x03 - x04 - x15 - Ep Name.mp4", 15)] [InlineData("Season 2009/Elementary - 2009x03 - x04 - x15 - Ep Name.mp4", 15)]
[InlineData(@"Season 2009/2009x03x04x15 - Ep Name.mp4", 15)] [InlineData("Season 2009/2009x03x04x15 - Ep Name.mp4", 15)]
[InlineData(@"Season 2009/Elementary - 2009x03x04x15 - Ep Name.mp4", 15)] [InlineData("Season 2009/Elementary - 2009x03x04x15 - Ep Name.mp4", 15)]
[InlineData(@"Season 2009/Elementary - S2009E23-E24-E26 - The Woman.mp4", 26)] [InlineData("Season 2009/Elementary - S2009E23-E24-E26 - The Woman.mp4", 26)]
[InlineData(@"Season 2009/S2009E23-E24-E26 - The Woman.mp4", 26)] [InlineData("Season 2009/S2009E23-E24-E26 - The Woman.mp4", 26)]
// Without season number // Without season number
[InlineData(@"Season 1/02 - blah.avi", null)] [InlineData("Season 1/02 - blah.avi", null)]
[InlineData(@"Season 2/02 - blah 14 blah.avi", null)] [InlineData("Season 2/02 - blah 14 blah.avi", null)]
[InlineData(@"Season 1/02 - blah-02 a.avi", null)] [InlineData("Season 1/02 - blah-02 a.avi", null)]
[InlineData(@"Season 2/02.avi", null)] [InlineData("Season 2/02.avi", null)]
[InlineData(@"Season 1/02-03 - blah.avi", 3)] [InlineData("Season 1/02-03 - blah.avi", 3)]
[InlineData(@"Season 2/02-04 - blah 14 blah.avi", 4)] [InlineData("Season 2/02-04 - blah 14 blah.avi", 4)]
[InlineData(@"Season 1/02-05 - blah-02 a.avi", 5)] [InlineData("Season 1/02-05 - blah-02 a.avi", 5)]
[InlineData(@"Season 2/02-04.avi", 4)] [InlineData("Season 2/02-04.avi", 4)]
[InlineData(@"Season 2 /[HorribleSubs] Hunter X Hunter - 136[720p].mkv", null)] [InlineData("Season 2 /[HorribleSubs] Hunter X Hunter - 136[720p].mkv", null)]
// With format specification that must not be detected as ending episode number // With format specification that must not be detected as ending episode number
[InlineData(@"Season 1/series-s09e14-1080p.mkv", null)] [InlineData("Season 1/series-s09e14-1080p.mkv", null)]
[InlineData(@"Season 1/series-s09e14-720p.mkv", null)] [InlineData("Season 1/series-s09e14-720p.mkv", null)]
[InlineData(@"Season 1/series-s09e14-720i.mkv", null)] [InlineData("Season 1/series-s09e14-720i.mkv", null)]
[InlineData(@"Season 1/MOONLIGHTING_s01e01-e04.mkv", 4)] [InlineData("Season 1/MOONLIGHTING_s01e01-e04.mkv", 4)]
[InlineData(@"Season 1/MOONLIGHTING_s01e01-e04", 4)] [InlineData("Season 1/MOONLIGHTING_s01e01-e04", 4)]
public void TestGetEndingEpisodeNumberFromFile(string filename, int? endingEpisodeNumber) public void TestGetEndingEpisodeNumberFromFile(string filename, int? endingEpisodeNumber)
{ {
var result = _episodePathParser.Parse(filename, false); var result = _episodePathParser.Parse(filename, false);

View File

@ -6,23 +6,23 @@ namespace Jellyfin.Naming.Tests.TV
public class SeasonFolderTests public class SeasonFolderTests
{ {
[Theory] [Theory]
[InlineData(@"/Drive/Season 1", 1, true)] [InlineData("/Drive/Season 1", 1, true)]
[InlineData(@"/Drive/Season 2", 2, true)] [InlineData("/Drive/Season 2", 2, true)]
[InlineData(@"/Drive/Season 02", 2, true)] [InlineData("/Drive/Season 02", 2, true)]
[InlineData(@"/Drive/Seinfeld/S02", 2, true)] [InlineData("/Drive/Seinfeld/S02", 2, true)]
[InlineData(@"/Drive/Seinfeld/2", 2, true)] [InlineData("/Drive/Seinfeld/2", 2, true)]
[InlineData(@"/Drive/Season 2009", 2009, true)] [InlineData("/Drive/Season 2009", 2009, true)]
[InlineData(@"/Drive/Season1", 1, true)] [InlineData("/Drive/Season1", 1, true)]
[InlineData(@"The Wonder Years/The.Wonder.Years.S04.PDTV.x264-JCH", 4, true)] [InlineData("The Wonder Years/The.Wonder.Years.S04.PDTV.x264-JCH", 4, true)]
[InlineData(@"/Drive/Season 7 (2016)", 7, false)] [InlineData("/Drive/Season 7 (2016)", 7, false)]
[InlineData(@"/Drive/Staffel 7 (2016)", 7, false)] [InlineData("/Drive/Staffel 7 (2016)", 7, false)]
[InlineData(@"/Drive/Stagione 7 (2016)", 7, false)] [InlineData("/Drive/Stagione 7 (2016)", 7, false)]
[InlineData(@"/Drive/Season (8)", null, false)] [InlineData("/Drive/Season (8)", null, false)]
[InlineData(@"/Drive/3.Staffel", 3, false)] [InlineData("/Drive/3.Staffel", 3, false)]
[InlineData(@"/Drive/s06e05", null, false)] [InlineData("/Drive/s06e05", null, false)]
[InlineData(@"/Drive/The.Legend.of.Condor.Heroes.2017.V2.web-dl.1080p.h264.aac-hdctv", null, false)] [InlineData("/Drive/The.Legend.of.Condor.Heroes.2017.V2.web-dl.1080p.h264.aac-hdctv", null, false)]
[InlineData(@"/Drive/extras", 0, true)] [InlineData("/Drive/extras", 0, true)]
[InlineData(@"/Drive/specials", 0, true)] [InlineData("/Drive/specials", 0, true)]
public void GetSeasonNumberFromPathTest(string path, int? seasonNumber, bool isSeasonDirectory) public void GetSeasonNumberFromPathTest(string path, int? seasonNumber, bool isSeasonDirectory)
{ {
var result = SeasonPathParser.Parse(path, true, true); var result = SeasonPathParser.Parse(path, true, true);

View File

@ -51,8 +51,8 @@ namespace Jellyfin.Naming.Tests.TV
[InlineData("Season 2009/Elementary - S2009E23-E24-E26 - The Woman.mp4", 2009)] [InlineData("Season 2009/Elementary - S2009E23-E24-E26 - The Woman.mp4", 2009)]
[InlineData("Season 2009/S2009E23-E24-E26 - The Woman.mp4", 2009)] [InlineData("Season 2009/S2009E23-E24-E26 - The Woman.mp4", 2009)]
[InlineData("Series/1-12 - The Woman.mp4", 1)] [InlineData("Series/1-12 - The Woman.mp4", 1)]
[InlineData(@"Running Man/Running Man S2017E368.mkv", 2017)] [InlineData("Running Man/Running Man S2017E368.mkv", 2017)]
[InlineData(@"Case Closed (1996-2007)/Case Closed - 317.mkv", 3)] [InlineData("Case Closed (1996-2007)/Case Closed - 317.mkv", 3)]
// TODO: [InlineData(@"Seinfeld/Seinfeld 0807 The Checks.avi", 8)] // TODO: [InlineData(@"Seinfeld/Seinfeld 0807 The Checks.avi", 8)]
public void GetSeasonNumberFromEpisodeFileTest(string path, int? expected) public void GetSeasonNumberFromEpisodeFileTest(string path, int? expected)
{ {

View File

@ -21,8 +21,8 @@ namespace Jellyfin.Naming.Tests.TV
[InlineData("Series/4x12 - The Woman.mp4", "", 4, 12)] [InlineData("Series/4x12 - The Woman.mp4", "", 4, 12)]
[InlineData("Series/LA X, Pt. 1_s06e32.mp4", "LA X, Pt. 1", 6, 32)] [InlineData("Series/LA X, Pt. 1_s06e32.mp4", "LA X, Pt. 1", 6, 32)]
[InlineData("[Baz-Bar]Foo - [1080p][Multiple Subtitle]/[Baz-Bar] Foo - 05 [1080p][Multiple Subtitle].mkv", "Foo", null, 5)] [InlineData("[Baz-Bar]Foo - [1080p][Multiple Subtitle]/[Baz-Bar] Foo - 05 [1080p][Multiple Subtitle].mkv", "Foo", null, 5)]
[InlineData(@"/Foo/The.Series.Name.S01E04.WEBRip.x264-Baz[Bar]/the.series.name.s01e04.webrip.x264-Baz[Bar].mkv", "The.Series.Name", 1, 4)] [InlineData("/Foo/The.Series.Name.S01E04.WEBRip.x264-Baz[Bar]/the.series.name.s01e04.webrip.x264-Baz[Bar].mkv", "The.Series.Name", 1, 4)]
[InlineData(@"Love.Death.and.Robots.S01.1080p.NF.WEB-DL.DDP5.1.x264-NTG/Love.Death.and.Robots.S01E01.Sonnies.Edge.1080p.NF.WEB-DL.DDP5.1.x264-NTG.mkv", "Love.Death.and.Robots", 1, 1)] [InlineData("Love.Death.and.Robots.S01.1080p.NF.WEB-DL.DDP5.1.x264-NTG/Love.Death.and.Robots.S01E01.Sonnies.Edge.1080p.NF.WEB-DL.DDP5.1.x264-NTG.mkv", "Love.Death.and.Robots", 1, 1)]
[InlineData("[YuiSubs] Tensura Nikki - Tensei Shitara Slime Datta Ken/[YuiSubs] Tensura Nikki - Tensei Shitara Slime Datta Ken - 12 (NVENC H.265 1080p).mkv", "Tensura Nikki - Tensei Shitara Slime Datta Ken", null, 12)] [InlineData("[YuiSubs] Tensura Nikki - Tensei Shitara Slime Datta Ken/[YuiSubs] Tensura Nikki - Tensei Shitara Slime Datta Ken - 12 (NVENC H.265 1080p).mkv", "Tensura Nikki - Tensei Shitara Slime Datta Ken", null, 12)]
[InlineData("[Baz-Bar]Foo - 01 - 12[1080p][Multiple Subtitle]/[Baz-Bar] Foo - 05 [1080p][Multiple Subtitle].mkv", "Foo", null, 5)] [InlineData("[Baz-Bar]Foo - 01 - 12[1080p][Multiple Subtitle]/[Baz-Bar] Foo - 05 [1080p][Multiple Subtitle].mkv", "Foo", null, 5)]
[InlineData("Series/4-12 - The Woman.mp4", "", 4, 12, 12)] [InlineData("Series/4-12 - The Woman.mp4", "", 4, 12, 12)]

View File

@ -10,34 +10,34 @@ namespace Jellyfin.Naming.Tests.Video
private readonly NamingOptions _namingOptions = new NamingOptions(); private readonly NamingOptions _namingOptions = new NamingOptions();
[Theory] [Theory]
[InlineData(@"The Wolf of Wall Street (2013).mkv", "The Wolf of Wall Street", 2013)] [InlineData("The Wolf of Wall Street (2013).mkv", "The Wolf of Wall Street", 2013)]
[InlineData(@"The Wolf of Wall Street 2 (2013).mkv", "The Wolf of Wall Street 2", 2013)] [InlineData("The Wolf of Wall Street 2 (2013).mkv", "The Wolf of Wall Street 2", 2013)]
[InlineData(@"The Wolf of Wall Street - 2 (2013).mkv", "The Wolf of Wall Street - 2", 2013)] [InlineData("The Wolf of Wall Street - 2 (2013).mkv", "The Wolf of Wall Street - 2", 2013)]
[InlineData(@"The Wolf of Wall Street 2001 (2013).mkv", "The Wolf of Wall Street 2001", 2013)] [InlineData("The Wolf of Wall Street 2001 (2013).mkv", "The Wolf of Wall Street 2001", 2013)]
[InlineData(@"300 (2006).mkv", "300", 2006)] [InlineData("300 (2006).mkv", "300", 2006)]
[InlineData(@"d:/movies/300 (2006).mkv", "300", 2006)] [InlineData("d:/movies/300 (2006).mkv", "300", 2006)]
[InlineData(@"300 2 (2006).mkv", "300 2", 2006)] [InlineData("300 2 (2006).mkv", "300 2", 2006)]
[InlineData(@"300 - 2 (2006).mkv", "300 - 2", 2006)] [InlineData("300 - 2 (2006).mkv", "300 - 2", 2006)]
[InlineData(@"300 2001 (2006).mkv", "300 2001", 2006)] [InlineData("300 2001 (2006).mkv", "300 2001", 2006)]
[InlineData(@"curse.of.chucky.2013.stv.unrated.multi.1080p.bluray.x264-rough", "curse.of.chucky", 2013)] [InlineData("curse.of.chucky.2013.stv.unrated.multi.1080p.bluray.x264-rough", "curse.of.chucky", 2013)]
[InlineData(@"curse.of.chucky.2013.stv.unrated.multi.2160p.bluray.x264-rough", "curse.of.chucky", 2013)] [InlineData("curse.of.chucky.2013.stv.unrated.multi.2160p.bluray.x264-rough", "curse.of.chucky", 2013)]
[InlineData(@"/server/Movies/300 (2007)/300 (2006).bluray.disc", "300", 2006)] [InlineData("/server/Movies/300 (2007)/300 (2006).bluray.disc", "300", 2006)]
[InlineData(@"Arrival.2016.2160p.Blu-Ray.HEVC.mkv", "Arrival", 2016)] [InlineData("Arrival.2016.2160p.Blu-Ray.HEVC.mkv", "Arrival", 2016)]
[InlineData(@"The Wolf of Wall Street (2013)", "The Wolf of Wall Street", 2013)] [InlineData("The Wolf of Wall Street (2013)", "The Wolf of Wall Street", 2013)]
[InlineData(@"The Wolf of Wall Street 2 (2013)", "The Wolf of Wall Street 2", 2013)] [InlineData("The Wolf of Wall Street 2 (2013)", "The Wolf of Wall Street 2", 2013)]
[InlineData(@"The Wolf of Wall Street - 2 (2013)", "The Wolf of Wall Street - 2", 2013)] [InlineData("The Wolf of Wall Street - 2 (2013)", "The Wolf of Wall Street - 2", 2013)]
[InlineData(@"The Wolf of Wall Street 2001 (2013)", "The Wolf of Wall Street 2001", 2013)] [InlineData("The Wolf of Wall Street 2001 (2013)", "The Wolf of Wall Street 2001", 2013)]
[InlineData(@"300 (2006)", "300", 2006)] [InlineData("300 (2006)", "300", 2006)]
[InlineData(@"d:/movies/300 (2006)", "300", 2006)] [InlineData("d:/movies/300 (2006)", "300", 2006)]
[InlineData(@"300 2 (2006)", "300 2", 2006)] [InlineData("300 2 (2006)", "300 2", 2006)]
[InlineData(@"300 - 2 (2006)", "300 - 2", 2006)] [InlineData("300 - 2 (2006)", "300 - 2", 2006)]
[InlineData(@"300 2001 (2006)", "300 2001", 2006)] [InlineData("300 2001 (2006)", "300 2001", 2006)]
[InlineData(@"/server/Movies/300 (2007)/300 (2006)", "300", 2006)] [InlineData("/server/Movies/300 (2007)/300 (2006)", "300", 2006)]
[InlineData(@"/server/Movies/300 (2007)/300 (2006).mkv", "300", 2006)] [InlineData("/server/Movies/300 (2007)/300 (2006).mkv", "300", 2006)]
[InlineData(@"American.Psycho.mkv", "American.Psycho.mkv", null)] [InlineData("American.Psycho.mkv", "American.Psycho.mkv", null)]
[InlineData(@"American Psycho.mkv", "American Psycho.mkv", null)] [InlineData("American Psycho.mkv", "American Psycho.mkv", null)]
[InlineData(@"[rec].mkv", "[rec].mkv", null)] [InlineData("[rec].mkv", "[rec].mkv", null)]
[InlineData(@"St. Vincent (2014)", "St. Vincent", 2014)] [InlineData("St. Vincent (2014)", "St. Vincent", 2014)]
[InlineData("Super movie(2009).mp4", "Super movie", 2009)] [InlineData("Super movie(2009).mp4", "Super movie", 2009)]
[InlineData("Drug War 2013.mp4", "Drug War", 2013)] [InlineData("Drug War 2013.mp4", "Drug War", 2013)]
[InlineData("My Movie (1997) - GreatestReleaseGroup 2019.mp4", "My Movie", 1997)] [InlineData("My Movie (1997) - GreatestReleaseGroup 2019.mp4", "My Movie", 1997)]
@ -45,9 +45,9 @@ namespace Jellyfin.Naming.Tests.Video
[InlineData("First Man (2018) 1080p.mkv", "First Man", 2018)] [InlineData("First Man (2018) 1080p.mkv", "First Man", 2018)]
[InlineData("Maximum Ride - 2016 - WEBDL-1080p - x264 AC3.mkv", "Maximum Ride", 2016)] [InlineData("Maximum Ride - 2016 - WEBDL-1080p - x264 AC3.mkv", "Maximum Ride", 2016)]
// FIXME: [InlineData("Robin Hood [Multi-Subs] [2018].mkv", "Robin Hood", 2018)] // FIXME: [InlineData("Robin Hood [Multi-Subs] [2018].mkv", "Robin Hood", 2018)]
[InlineData(@"3.Days.to.Kill.2014.720p.BluRay.x264.YIFY.mkv", "3.Days.to.Kill", 2014)] // In this test case, running CleanDateTime first produces no date, so it will attempt to run CleanString first and then CleanDateTime again [InlineData("3.Days.to.Kill.2014.720p.BluRay.x264.YIFY.mkv", "3.Days.to.Kill", 2014)] // In this test case, running CleanDateTime first produces no date, so it will attempt to run CleanString first and then CleanDateTime again
[InlineData("3 days to kill (2005).mkv", "3 days to kill", 2005)] [InlineData("3 days to kill (2005).mkv", "3 days to kill", 2005)]
[InlineData(@"Rain Man 1988 REMASTERED 1080p BluRay x264 AAC - Ozlem.mp4", "Rain Man", 1988)] [InlineData("Rain Man 1988 REMASTERED 1080p BluRay x264 AAC - Ozlem.mp4", "Rain Man", 1988)]
[InlineData("My Movie 2013.12.09", "My Movie 2013.12.09", null)] [InlineData("My Movie 2013.12.09", "My Movie 2013.12.09", null)]
[InlineData("My Movie 2013-12-09", "My Movie 2013-12-09", null)] [InlineData("My Movie 2013-12-09", "My Movie 2013-12-09", null)]
[InlineData("My Movie 20131209", "My Movie 20131209", null)] [InlineData("My Movie 20131209", "My Movie 20131209", null)]

View File

@ -22,7 +22,7 @@ namespace Jellyfin.Naming.Tests.Video
[Fact] [Fact]
public void Test3DName() public void Test3DName()
{ {
var result = VideoResolver.ResolveFile(@"C:/Users/media/Desktop/Video Test/Movies/Oblivion/Oblivion.3d.hsbs.mkv", _namingOptions); var result = VideoResolver.ResolveFile("C:/Users/media/Desktop/Video Test/Movies/Oblivion/Oblivion.3d.hsbs.mkv", _namingOptions);
Assert.Equal("hsbs", result?.Format3D); Assert.Equal("hsbs", result?.Format3D);
Assert.Equal("Oblivion", result?.Name); Assert.Equal("Oblivion", result?.Name);

View File

@ -15,10 +15,10 @@ namespace Jellyfin.Naming.Tests.Video
{ {
var files = new[] var files = new[]
{ {
@"/movies/X-Men Days of Future Past/X-Men Days of Future Past - 1080p.mkv", "/movies/X-Men Days of Future Past/X-Men Days of Future Past - 1080p.mkv",
@"/movies/X-Men Days of Future Past/X-Men Days of Future Past-trailer.mp4", "/movies/X-Men Days of Future Past/X-Men Days of Future Past-trailer.mp4",
@"/movies/X-Men Days of Future Past/X-Men Days of Future Past - [hsbs].mkv", "/movies/X-Men Days of Future Past/X-Men Days of Future Past - [hsbs].mkv",
@"/movies/X-Men Days of Future Past/X-Men Days of Future Past [hsbs].mkv" "/movies/X-Men Days of Future Past/X-Men Days of Future Past [hsbs].mkv"
}; };
var result = VideoListResolver.Resolve( var result = VideoListResolver.Resolve(
@ -34,10 +34,10 @@ namespace Jellyfin.Naming.Tests.Video
{ {
var files = new[] var files = new[]
{ {
@"/movies/X-Men Days of Future Past/X-Men Days of Future Past - apple.mkv", "/movies/X-Men Days of Future Past/X-Men Days of Future Past - apple.mkv",
@"/movies/X-Men Days of Future Past/X-Men Days of Future Past-trailer.mp4", "/movies/X-Men Days of Future Past/X-Men Days of Future Past-trailer.mp4",
@"/movies/X-Men Days of Future Past/X-Men Days of Future Past - banana.mkv", "/movies/X-Men Days of Future Past/X-Men Days of Future Past - banana.mkv",
@"/movies/X-Men Days of Future Past/X-Men Days of Future Past [banana].mp4" "/movies/X-Men Days of Future Past/X-Men Days of Future Past [banana].mp4"
}; };
var result = VideoListResolver.Resolve( var result = VideoListResolver.Resolve(
@ -54,8 +54,8 @@ namespace Jellyfin.Naming.Tests.Video
{ {
var files = new[] var files = new[]
{ {
@"/movies/The Phantom of the Opera (1925)/The Phantom of the Opera (1925) - 1925 version.mkv", "/movies/The Phantom of the Opera (1925)/The Phantom of the Opera (1925) - 1925 version.mkv",
@"/movies/The Phantom of the Opera (1925)/The Phantom of the Opera (1925) - 1929 version.mkv" "/movies/The Phantom of the Opera (1925)/The Phantom of the Opera (1925) - 1929 version.mkv"
}; };
var result = VideoListResolver.Resolve( var result = VideoListResolver.Resolve(
@ -71,13 +71,13 @@ namespace Jellyfin.Naming.Tests.Video
{ {
var files = new[] var files = new[]
{ {
@"/movies/M/Movie 1.mkv", "/movies/M/Movie 1.mkv",
@"/movies/M/Movie 2.mkv", "/movies/M/Movie 2.mkv",
@"/movies/M/Movie 3.mkv", "/movies/M/Movie 3.mkv",
@"/movies/M/Movie 4.mkv", "/movies/M/Movie 4.mkv",
@"/movies/M/Movie 5.mkv", "/movies/M/Movie 5.mkv",
@"/movies/M/Movie 6.mkv", "/movies/M/Movie 6.mkv",
@"/movies/M/Movie 7.mkv" "/movies/M/Movie 7.mkv"
}; };
var result = VideoListResolver.Resolve( var result = VideoListResolver.Resolve(
@ -93,14 +93,14 @@ namespace Jellyfin.Naming.Tests.Video
{ {
var files = new[] var files = new[]
{ {
@"/movies/Movie/Movie.mkv", "/movies/Movie/Movie.mkv",
@"/movies/Movie/Movie-2.mkv", "/movies/Movie/Movie-2.mkv",
@"/movies/Movie/Movie-3.mkv", "/movies/Movie/Movie-3.mkv",
@"/movies/Movie/Movie-4.mkv", "/movies/Movie/Movie-4.mkv",
@"/movies/Movie/Movie-5.mkv", "/movies/Movie/Movie-5.mkv",
@"/movies/Movie/Movie-6.mkv", "/movies/Movie/Movie-6.mkv",
@"/movies/Movie/Movie-7.mkv", "/movies/Movie/Movie-7.mkv",
@"/movies/Movie/Movie-8.mkv" "/movies/Movie/Movie-8.mkv"
}; };
var result = VideoListResolver.Resolve( var result = VideoListResolver.Resolve(
@ -116,15 +116,15 @@ namespace Jellyfin.Naming.Tests.Video
{ {
var files = new[] var files = new[]
{ {
@"/movies/Mo/Movie 1.mkv", "/movies/Mo/Movie 1.mkv",
@"/movies/Mo/Movie 2.mkv", "/movies/Mo/Movie 2.mkv",
@"/movies/Mo/Movie 3.mkv", "/movies/Mo/Movie 3.mkv",
@"/movies/Mo/Movie 4.mkv", "/movies/Mo/Movie 4.mkv",
@"/movies/Mo/Movie 5.mkv", "/movies/Mo/Movie 5.mkv",
@"/movies/Mo/Movie 6.mkv", "/movies/Mo/Movie 6.mkv",
@"/movies/Mo/Movie 7.mkv", "/movies/Mo/Movie 7.mkv",
@"/movies/Mo/Movie 8.mkv", "/movies/Mo/Movie 8.mkv",
@"/movies/Mo/Movie 9.mkv" "/movies/Mo/Movie 9.mkv"
}; };
var result = VideoListResolver.Resolve( var result = VideoListResolver.Resolve(
@ -140,11 +140,11 @@ namespace Jellyfin.Naming.Tests.Video
{ {
var files = new[] var files = new[]
{ {
@"/movies/Movie/Movie 1.mkv", "/movies/Movie/Movie 1.mkv",
@"/movies/Movie/Movie 2.mkv", "/movies/Movie/Movie 2.mkv",
@"/movies/Movie/Movie 3.mkv", "/movies/Movie/Movie 3.mkv",
@"/movies/Movie/Movie 4.mkv", "/movies/Movie/Movie 4.mkv",
@"/movies/Movie/Movie 5.mkv" "/movies/Movie/Movie 5.mkv"
}; };
var result = VideoListResolver.Resolve( var result = VideoListResolver.Resolve(
@ -162,11 +162,11 @@ namespace Jellyfin.Naming.Tests.Video
var files = new[] var files = new[]
{ {
@"/movies/Iron Man/Iron Man.mkv", "/movies/Iron Man/Iron Man.mkv",
@"/movies/Iron Man/Iron Man (2008).mkv", "/movies/Iron Man/Iron Man (2008).mkv",
@"/movies/Iron Man/Iron Man (2009).mkv", "/movies/Iron Man/Iron Man (2009).mkv",
@"/movies/Iron Man/Iron Man (2010).mkv", "/movies/Iron Man/Iron Man (2010).mkv",
@"/movies/Iron Man/Iron Man (2011).mkv" "/movies/Iron Man/Iron Man (2011).mkv"
}; };
var result = VideoListResolver.Resolve( var result = VideoListResolver.Resolve(
@ -182,13 +182,13 @@ namespace Jellyfin.Naming.Tests.Video
{ {
var files = new[] var files = new[]
{ {
@"/movies/Iron Man/Iron Man.mkv", "/movies/Iron Man/Iron Man.mkv",
@"/movies/Iron Man/Iron Man-720p.mkv", "/movies/Iron Man/Iron Man-720p.mkv",
@"/movies/Iron Man/Iron Man-test.mkv", "/movies/Iron Man/Iron Man-test.mkv",
@"/movies/Iron Man/Iron Man-bluray.mkv", "/movies/Iron Man/Iron Man-bluray.mkv",
@"/movies/Iron Man/Iron Man-3d.mkv", "/movies/Iron Man/Iron Man-3d.mkv",
@"/movies/Iron Man/Iron Man-3d-hsbs.mkv", "/movies/Iron Man/Iron Man-3d-hsbs.mkv",
@"/movies/Iron Man/Iron Man[test].mkv" "/movies/Iron Man/Iron Man[test].mkv"
}; };
var result = VideoListResolver.Resolve( var result = VideoListResolver.Resolve(
@ -211,13 +211,13 @@ namespace Jellyfin.Naming.Tests.Video
{ {
var files = new[] var files = new[]
{ {
@"/movies/Iron Man/Iron Man.mkv", "/movies/Iron Man/Iron Man.mkv",
@"/movies/Iron Man/Iron Man - 720p.mkv", "/movies/Iron Man/Iron Man - 720p.mkv",
@"/movies/Iron Man/Iron Man - test.mkv", "/movies/Iron Man/Iron Man - test.mkv",
@"/movies/Iron Man/Iron Man - bluray.mkv", "/movies/Iron Man/Iron Man - bluray.mkv",
@"/movies/Iron Man/Iron Man - 3d.mkv", "/movies/Iron Man/Iron Man - 3d.mkv",
@"/movies/Iron Man/Iron Man - 3d-hsbs.mkv", "/movies/Iron Man/Iron Man - 3d-hsbs.mkv",
@"/movies/Iron Man/Iron Man [test].mkv" "/movies/Iron Man/Iron Man [test].mkv"
}; };
var result = VideoListResolver.Resolve( var result = VideoListResolver.Resolve(
@ -240,8 +240,8 @@ namespace Jellyfin.Naming.Tests.Video
{ {
var files = new[] var files = new[]
{ {
@"/movies/Iron Man/Iron Man - B (2006).mkv", "/movies/Iron Man/Iron Man - B (2006).mkv",
@"/movies/Iron Man/Iron Man - C (2007).mkv" "/movies/Iron Man/Iron Man - C (2007).mkv"
}; };
var result = VideoListResolver.Resolve( var result = VideoListResolver.Resolve(
@ -256,13 +256,13 @@ namespace Jellyfin.Naming.Tests.Video
{ {
var files = new[] var files = new[]
{ {
@"/movies/Iron Man/Iron Man.mkv", "/movies/Iron Man/Iron Man.mkv",
@"/movies/Iron Man/Iron Man_720p.mkv", "/movies/Iron Man/Iron Man_720p.mkv",
@"/movies/Iron Man/Iron Man_test.mkv", "/movies/Iron Man/Iron Man_test.mkv",
@"/movies/Iron Man/Iron Man_bluray.mkv", "/movies/Iron Man/Iron Man_bluray.mkv",
@"/movies/Iron Man/Iron Man_3d.mkv", "/movies/Iron Man/Iron Man_3d.mkv",
@"/movies/Iron Man/Iron Man_3d-hsbs.mkv", "/movies/Iron Man/Iron Man_3d-hsbs.mkv",
@"/movies/Iron Man/Iron Man_3d.hsbs.mkv" "/movies/Iron Man/Iron Man_3d.hsbs.mkv"
}; };
var result = VideoListResolver.Resolve( var result = VideoListResolver.Resolve(
@ -280,11 +280,11 @@ namespace Jellyfin.Naming.Tests.Video
var files = new[] var files = new[]
{ {
@"/movies/Iron Man/Iron Man (2007).mkv", "/movies/Iron Man/Iron Man (2007).mkv",
@"/movies/Iron Man/Iron Man (2008).mkv", "/movies/Iron Man/Iron Man (2008).mkv",
@"/movies/Iron Man/Iron Man (2009).mkv", "/movies/Iron Man/Iron Man (2009).mkv",
@"/movies/Iron Man/Iron Man (2010).mkv", "/movies/Iron Man/Iron Man (2010).mkv",
@"/movies/Iron Man/Iron Man (2011).mkv" "/movies/Iron Man/Iron Man (2011).mkv"
}; };
var result = VideoListResolver.Resolve( var result = VideoListResolver.Resolve(
@ -300,8 +300,8 @@ namespace Jellyfin.Naming.Tests.Video
{ {
var files = new[] var files = new[]
{ {
@"/movies/Blade Runner (1982)/Blade Runner (1982) [Final Cut] [1080p HEVC AAC].mkv", "/movies/Blade Runner (1982)/Blade Runner (1982) [Final Cut] [1080p HEVC AAC].mkv",
@"/movies/Blade Runner (1982)/Blade Runner (1982) [EE by ADM] [480p HEVC AAC,AAC,AAC].mkv" "/movies/Blade Runner (1982)/Blade Runner (1982) [EE by ADM] [480p HEVC AAC,AAC,AAC].mkv"
}; };
var result = VideoListResolver.Resolve( var result = VideoListResolver.Resolve(
@ -317,8 +317,8 @@ namespace Jellyfin.Naming.Tests.Video
{ {
var files = new[] var files = new[]
{ {
@"/movies/X-Men Apocalypse (2016)/X-Men Apocalypse (2016) [1080p] Blu-ray.x264.DTS.mkv", "/movies/X-Men Apocalypse (2016)/X-Men Apocalypse (2016) [1080p] Blu-ray.x264.DTS.mkv",
@"/movies/X-Men Apocalypse (2016)/X-Men Apocalypse (2016) [2160p] Blu-ray.x265.AAC.mkv" "/movies/X-Men Apocalypse (2016)/X-Men Apocalypse (2016) [2160p] Blu-ray.x265.AAC.mkv"
}; };
var result = VideoListResolver.Resolve( var result = VideoListResolver.Resolve(
@ -334,12 +334,12 @@ namespace Jellyfin.Naming.Tests.Video
{ {
var files = new[] var files = new[]
{ {
@"/movies/X-Men Apocalypse (2016)/X-Men Apocalypse (2016) - Theatrical Release.mkv", "/movies/X-Men Apocalypse (2016)/X-Men Apocalypse (2016) - Theatrical Release.mkv",
@"/movies/X-Men Apocalypse (2016)/X-Men Apocalypse (2016) - Directors Cut.mkv", "/movies/X-Men Apocalypse (2016)/X-Men Apocalypse (2016) - Directors Cut.mkv",
@"/movies/X-Men Apocalypse (2016)/X-Men Apocalypse (2016) - 1080p.mkv", "/movies/X-Men Apocalypse (2016)/X-Men Apocalypse (2016) - 1080p.mkv",
@"/movies/X-Men Apocalypse (2016)/X-Men Apocalypse (2016) - 2160p.mkv", "/movies/X-Men Apocalypse (2016)/X-Men Apocalypse (2016) - 2160p.mkv",
@"/movies/X-Men Apocalypse (2016)/X-Men Apocalypse (2016) - 720p.mkv", "/movies/X-Men Apocalypse (2016)/X-Men Apocalypse (2016) - 720p.mkv",
@"/movies/X-Men Apocalypse (2016)/X-Men Apocalypse (2016).mkv", "/movies/X-Men Apocalypse (2016)/X-Men Apocalypse (2016).mkv",
}; };
var result = VideoListResolver.Resolve( var result = VideoListResolver.Resolve(
@ -361,8 +361,8 @@ namespace Jellyfin.Naming.Tests.Video
{ {
var files = new[] var files = new[]
{ {
@"/movies/John Wick - Kapitel 3 (2019) [imdbid=tt6146586]/John Wick - Kapitel 3 (2019) [imdbid=tt6146586] - Version 1.mkv", "/movies/John Wick - Kapitel 3 (2019) [imdbid=tt6146586]/John Wick - Kapitel 3 (2019) [imdbid=tt6146586] - Version 1.mkv",
@"/movies/John Wick - Kapitel 3 (2019) [imdbid=tt6146586]/John Wick - Kapitel 3 (2019) [imdbid=tt6146586] - Version 2.mkv" "/movies/John Wick - Kapitel 3 (2019) [imdbid=tt6146586]/John Wick - Kapitel 3 (2019) [imdbid=tt6146586] - Version 2.mkv"
}; };
var result = VideoListResolver.Resolve( var result = VideoListResolver.Resolve(
@ -378,8 +378,8 @@ namespace Jellyfin.Naming.Tests.Video
{ {
var files = new[] var files = new[]
{ {
@"/movies/John Wick - Chapter 3 (2019)/John Wick - Chapter 3 (2019) [Version 1].mkv", "/movies/John Wick - Chapter 3 (2019)/John Wick - Chapter 3 (2019) [Version 1].mkv",
@"/movies/John Wick - Chapter 3 (2019)/John Wick - Chapter 3 (2019) [Version 2.mkv" "/movies/John Wick - Chapter 3 (2019)/John Wick - Chapter 3 (2019) [Version 2.mkv"
}; };
var result = VideoListResolver.Resolve( var result = VideoListResolver.Resolve(

View File

@ -384,8 +384,8 @@ namespace Jellyfin.Naming.Tests.Video
// No stacking here because there is no part/disc/etc // No stacking here because there is no part/disc/etc
var files = new[] var files = new[]
{ {
@"M:/Movies (DVD)/Movies (Musical)/The Sound of Music/The Sound of Music (1965) (Disc 01)", "M:/Movies (DVD)/Movies (Musical)/The Sound of Music/The Sound of Music (1965) (Disc 01)",
@"M:/Movies (DVD)/Movies (Musical)/The Sound of Music/The Sound of Music (1965) (Disc 02)" "M:/Movies (DVD)/Movies (Musical)/The Sound of Music/The Sound of Music (1965) (Disc 02)"
}; };
var result = StackResolver.ResolveDirectories(files, _namingOptions).ToList(); var result = StackResolver.ResolveDirectories(files, _namingOptions).ToList();

View File

@ -29,7 +29,7 @@ namespace Jellyfin.Naming.Tests.Video
[Fact] [Fact]
public void TestStubName() public void TestStubName()
{ {
var result = VideoResolver.ResolveFile(@"C:/Users/media/Desktop/Video Test/Movies/Oblivion/Oblivion.dvd.disc", _namingOptions); var result = VideoResolver.ResolveFile("C:/Users/media/Desktop/Video Test/Movies/Oblivion/Oblivion.dvd.disc", _namingOptions);
Assert.Equal("Oblivion", result?.Name); Assert.Equal("Oblivion", result?.Name);
} }

View File

@ -200,8 +200,8 @@ namespace Jellyfin.Naming.Tests.Video
{ {
var files = new[] var files = new[]
{ {
@"M:/Movies (DVD)/Movies (Musical)/Sound of Music (1965)/Sound of Music Disc 1", "M:/Movies (DVD)/Movies (Musical)/Sound of Music (1965)/Sound of Music Disc 1",
@"M:/Movies (DVD)/Movies (Musical)/Sound of Music (1965)/Sound of Music Disc 2" "M:/Movies (DVD)/Movies (Musical)/Sound of Music (1965)/Sound of Music Disc 2"
}; };
var result = VideoListResolver.Resolve( var result = VideoListResolver.Resolve(
@ -217,8 +217,8 @@ namespace Jellyfin.Naming.Tests.Video
// These should be considered separate, unrelated videos // These should be considered separate, unrelated videos
var files = new[] var files = new[]
{ {
@"My movie #1.mp4", "My movie #1.mp4",
@"My movie #2.mp4" "My movie #2.mp4"
}; };
var result = VideoListResolver.Resolve( var result = VideoListResolver.Resolve(
@ -233,10 +233,10 @@ namespace Jellyfin.Naming.Tests.Video
{ {
var files = new[] var files = new[]
{ {
@"No (2012) part1.mp4", "No (2012) part1.mp4",
@"No (2012) part2.mp4", "No (2012) part2.mp4",
@"No (2012) part1-trailer.mp4", "No (2012) part1-trailer.mp4",
@"No (2012)-trailer.mp4" "No (2012)-trailer.mp4"
}; };
var result = VideoListResolver.Resolve( var result = VideoListResolver.Resolve(
@ -254,10 +254,10 @@ namespace Jellyfin.Naming.Tests.Video
{ {
var files = new[] var files = new[]
{ {
@"/Movies/Top Gun (1984)/movie.mp4", "/Movies/Top Gun (1984)/movie.mp4",
@"/Movies/Top Gun (1984)/Top Gun (1984)-trailer.mp4", "/Movies/Top Gun (1984)/Top Gun (1984)-trailer.mp4",
@"/Movies/Top Gun (1984)/Top Gun (1984)-trailer2.mp4", "/Movies/Top Gun (1984)/Top Gun (1984)-trailer2.mp4",
@"/Movies/trailer.mp4" "/Movies/trailer.mp4"
}; };
var result = VideoListResolver.Resolve( var result = VideoListResolver.Resolve(
@ -276,10 +276,10 @@ namespace Jellyfin.Naming.Tests.Video
{ {
var files = new[] var files = new[]
{ {
@"/MCFAMILY-PC/Private3$/Heterosexual/Breast In Class 2 Counterfeit Racks (2011)/Breast In Class 2 Counterfeit Racks (2011) Disc 1 cd1.avi", "/MCFAMILY-PC/Private3$/Heterosexual/Breast In Class 2 Counterfeit Racks (2011)/Breast In Class 2 Counterfeit Racks (2011) Disc 1 cd1.avi",
@"/MCFAMILY-PC/Private3$/Heterosexual/Breast In Class 2 Counterfeit Racks (2011)/Breast In Class 2 Counterfeit Racks (2011) Disc 1 cd2.avi", "/MCFAMILY-PC/Private3$/Heterosexual/Breast In Class 2 Counterfeit Racks (2011)/Breast In Class 2 Counterfeit Racks (2011) Disc 1 cd2.avi",
@"/MCFAMILY-PC/Private3$/Heterosexual/Breast In Class 2 Counterfeit Racks (2011)/Breast In Class 2 Disc 2 cd1.avi", "/MCFAMILY-PC/Private3$/Heterosexual/Breast In Class 2 Counterfeit Racks (2011)/Breast In Class 2 Disc 2 cd1.avi",
@"/MCFAMILY-PC/Private3$/Heterosexual/Breast In Class 2 Counterfeit Racks (2011)/Breast In Class 2 Disc 2 cd2.avi" "/MCFAMILY-PC/Private3$/Heterosexual/Breast In Class 2 Counterfeit Racks (2011)/Breast In Class 2 Disc 2 cd2.avi"
}; };
var result = VideoListResolver.Resolve( var result = VideoListResolver.Resolve(
@ -294,7 +294,7 @@ namespace Jellyfin.Naming.Tests.Video
{ {
var files = new[] var files = new[]
{ {
@"/nas-markrobbo78/Videos/INDEX HTPC/Movies/Watched/3 - ACTION/Argo (2012)/movie.mkv" "/nas-markrobbo78/Videos/INDEX HTPC/Movies/Watched/3 - ACTION/Argo (2012)/movie.mkv"
}; };
var result = VideoListResolver.Resolve( var result = VideoListResolver.Resolve(
@ -309,7 +309,7 @@ namespace Jellyfin.Naming.Tests.Video
{ {
var files = new[] var files = new[]
{ {
@"The Colony.mkv" "The Colony.mkv"
}; };
var result = VideoListResolver.Resolve( var result = VideoListResolver.Resolve(
@ -324,8 +324,8 @@ namespace Jellyfin.Naming.Tests.Video
{ {
var files = new[] var files = new[]
{ {
@"Four Sisters and a Wedding - A.avi", "Four Sisters and a Wedding - A.avi",
@"Four Sisters and a Wedding - B.avi" "Four Sisters and a Wedding - B.avi"
}; };
var result = VideoListResolver.Resolve( var result = VideoListResolver.Resolve(
@ -342,8 +342,8 @@ namespace Jellyfin.Naming.Tests.Video
{ {
var files = new[] var files = new[]
{ {
@"Four Rooms - A.avi", "Four Rooms - A.avi",
@"Four Rooms - A.mp4" "Four Rooms - A.mp4"
}; };
var result = VideoListResolver.Resolve( var result = VideoListResolver.Resolve(
@ -358,8 +358,8 @@ namespace Jellyfin.Naming.Tests.Video
{ {
var files = new[] var files = new[]
{ {
@"/Server/Despicable Me/Despicable Me (2010).mkv", "/Server/Despicable Me/Despicable Me (2010).mkv",
@"/Server/Despicable Me/trailer.mkv" "/Server/Despicable Me/trailer.mkv"
}; };
var result = VideoListResolver.Resolve( var result = VideoListResolver.Resolve(
@ -376,8 +376,8 @@ namespace Jellyfin.Naming.Tests.Video
{ {
var files = new[] var files = new[]
{ {
@"/Server/Despicable Me/Despicable Me (2010).mkv", "/Server/Despicable Me/Despicable Me (2010).mkv",
@"/Server/Despicable Me/trailers/some title.mkv" "/Server/Despicable Me/trailers/some title.mkv"
}; };
var result = VideoListResolver.Resolve( var result = VideoListResolver.Resolve(
@ -394,8 +394,8 @@ namespace Jellyfin.Naming.Tests.Video
{ {
var files = new[] var files = new[]
{ {
@"/Movies/Despicable Me/Despicable Me.mkv", "/Movies/Despicable Me/Despicable Me.mkv",
@"/Movies/Despicable Me/trailers/trailer.mkv" "/Movies/Despicable Me/trailers/trailer.mkv"
}; };
var result = VideoListResolver.Resolve( var result = VideoListResolver.Resolve(

View File

@ -15,26 +15,26 @@ namespace Jellyfin.Naming.Tests.Video
var data = new TheoryData<VideoFileInfo>(); var data = new TheoryData<VideoFileInfo>();
data.Add( data.Add(
new VideoFileInfo( new VideoFileInfo(
path: @"/server/Movies/7 Psychos.mkv/7 Psychos.mkv", path: "/server/Movies/7 Psychos.mkv/7 Psychos.mkv",
container: "mkv", container: "mkv",
name: "7 Psychos")); name: "7 Psychos"));
data.Add( data.Add(
new VideoFileInfo( new VideoFileInfo(
path: @"/server/Movies/3 days to kill (2005)/3 days to kill (2005).mkv", path: "/server/Movies/3 days to kill (2005)/3 days to kill (2005).mkv",
container: "mkv", container: "mkv",
name: "3 days to kill", name: "3 days to kill",
year: 2005)); year: 2005));
data.Add( data.Add(
new VideoFileInfo( new VideoFileInfo(
path: @"/server/Movies/American Psycho/American.Psycho.mkv", path: "/server/Movies/American Psycho/American.Psycho.mkv",
container: "mkv", container: "mkv",
name: "American.Psycho")); name: "American.Psycho"));
data.Add( data.Add(
new VideoFileInfo( new VideoFileInfo(
path: @"/server/Movies/brave (2007)/brave (2006).3d.sbs.mkv", path: "/server/Movies/brave (2007)/brave (2006).3d.sbs.mkv",
container: "mkv", container: "mkv",
name: "brave", name: "brave",
year: 2006, year: 2006,
@ -43,14 +43,14 @@ namespace Jellyfin.Naming.Tests.Video
data.Add( data.Add(
new VideoFileInfo( new VideoFileInfo(
path: @"/server/Movies/300 (2007)/300 (2006).3d1.sbas.mkv", path: "/server/Movies/300 (2007)/300 (2006).3d1.sbas.mkv",
container: "mkv", container: "mkv",
name: "300", name: "300",
year: 2006)); year: 2006));
data.Add( data.Add(
new VideoFileInfo( new VideoFileInfo(
path: @"/server/Movies/300 (2007)/300 (2006).3d.sbs.mkv", path: "/server/Movies/300 (2007)/300 (2006).3d.sbs.mkv",
container: "mkv", container: "mkv",
name: "300", name: "300",
year: 2006, year: 2006,
@ -59,7 +59,7 @@ namespace Jellyfin.Naming.Tests.Video
data.Add( data.Add(
new VideoFileInfo( new VideoFileInfo(
path: @"/server/Movies/brave (2007)/brave (2006)-trailer.bluray.disc", path: "/server/Movies/brave (2007)/brave (2006)-trailer.bluray.disc",
container: "disc", container: "disc",
name: "brave", name: "brave",
year: 2006, year: 2006,
@ -68,7 +68,7 @@ namespace Jellyfin.Naming.Tests.Video
data.Add( data.Add(
new VideoFileInfo( new VideoFileInfo(
path: @"/server/Movies/300 (2007)/300 (2006)-trailer.bluray.disc", path: "/server/Movies/300 (2007)/300 (2006)-trailer.bluray.disc",
container: "disc", container: "disc",
name: "300", name: "300",
year: 2006, year: 2006,
@ -77,7 +77,7 @@ namespace Jellyfin.Naming.Tests.Video
data.Add( data.Add(
new VideoFileInfo( new VideoFileInfo(
path: @"/server/Movies/Brave (2007)/Brave (2006).bluray.disc", path: "/server/Movies/Brave (2007)/Brave (2006).bluray.disc",
container: "disc", container: "disc",
name: "Brave", name: "Brave",
year: 2006, year: 2006,
@ -86,7 +86,7 @@ namespace Jellyfin.Naming.Tests.Video
data.Add( data.Add(
new VideoFileInfo( new VideoFileInfo(
path: @"/server/Movies/300 (2007)/300 (2006).bluray.disc", path: "/server/Movies/300 (2007)/300 (2006).bluray.disc",
container: "disc", container: "disc",
name: "300", name: "300",
year: 2006, year: 2006,
@ -95,7 +95,7 @@ namespace Jellyfin.Naming.Tests.Video
data.Add( data.Add(
new VideoFileInfo( new VideoFileInfo(
path: @"/server/Movies/300 (2007)/300 (2006)-trailer.mkv", path: "/server/Movies/300 (2007)/300 (2006)-trailer.mkv",
container: "mkv", container: "mkv",
name: "300", name: "300",
year: 2006, year: 2006,
@ -103,7 +103,7 @@ namespace Jellyfin.Naming.Tests.Video
data.Add( data.Add(
new VideoFileInfo( new VideoFileInfo(
path: @"/server/Movies/Brave (2007)/Brave (2006)-trailer.mkv", path: "/server/Movies/Brave (2007)/Brave (2006)-trailer.mkv",
container: "mkv", container: "mkv",
name: "Brave", name: "Brave",
year: 2006, year: 2006,
@ -111,28 +111,28 @@ namespace Jellyfin.Naming.Tests.Video
data.Add( data.Add(
new VideoFileInfo( new VideoFileInfo(
path: @"/server/Movies/300 (2007)/300 (2006).mkv", path: "/server/Movies/300 (2007)/300 (2006).mkv",
container: "mkv", container: "mkv",
name: "300", name: "300",
year: 2006)); year: 2006));
data.Add( data.Add(
new VideoFileInfo( new VideoFileInfo(
path: @"/server/Movies/Bad Boys (1995)/Bad Boys (1995).mkv", path: "/server/Movies/Bad Boys (1995)/Bad Boys (1995).mkv",
container: "mkv", container: "mkv",
name: "Bad Boys", name: "Bad Boys",
year: 1995)); year: 1995));
data.Add( data.Add(
new VideoFileInfo( new VideoFileInfo(
path: @"/server/Movies/Brave (2007)/Brave (2006).mkv", path: "/server/Movies/Brave (2007)/Brave (2006).mkv",
container: "mkv", container: "mkv",
name: "Brave", name: "Brave",
year: 2006)); year: 2006));
data.Add( data.Add(
new VideoFileInfo( new VideoFileInfo(
path: @"/server/Movies/Rain Man 1988 REMASTERED 1080p BluRay x264 AAC - JEFF/Rain Man 1988 REMASTERED 1080p BluRay x264 AAC - JEFF.mp4", path: "/server/Movies/Rain Man 1988 REMASTERED 1080p BluRay x264 AAC - JEFF/Rain Man 1988 REMASTERED 1080p BluRay x264 AAC - JEFF.mp4",
container: "mp4", container: "mp4",
name: "Rain Man", name: "Rain Man",
year: 1988)); year: 1988));
@ -174,8 +174,8 @@ namespace Jellyfin.Naming.Tests.Video
{ {
var paths = new[] var paths = new[]
{ {
@"/Server/Iron Man", "/Server/Iron Man",
@"Batman", "Batman",
string.Empty string.Empty
}; };

View File

@ -352,11 +352,11 @@ namespace Jellyfin.Providers.Tests.Manager
{ {
if (forceRefresh) if (forceRefresh)
{ {
Assert.Matches(@"image url [0-9]", image.Path); Assert.Matches("image url [0-9]", image.Path);
} }
else else
{ {
Assert.DoesNotMatch(@"image url [0-9]", image.Path); Assert.DoesNotMatch("image url [0-9]", image.Path);
} }
} }
} }

View File

@ -29,7 +29,7 @@ public class MediaInfoResolverTests
public const string VideoDirectoryPath = "Test Data/Video"; public const string VideoDirectoryPath = "Test Data/Video";
public const string VideoDirectoryRegex = @"Test Data[/\\]Video"; public const string VideoDirectoryRegex = @"Test Data[/\\]Video";
public const string MetadataDirectoryPath = "library/00/00000000000000000000000000000000"; public const string MetadataDirectoryPath = "library/00/00000000000000000000000000000000";
public const string MetadataDirectoryRegex = @"library.*"; public const string MetadataDirectoryRegex = "library.*";
private readonly ILocalizationManager _localizationManager; private readonly ILocalizationManager _localizationManager;
private readonly MediaInfoResolver _subtitleResolver; private readonly MediaInfoResolver _subtitleResolver;
@ -49,7 +49,7 @@ public class MediaInfoResolverTests
var englishCultureDto = new CultureDto("English", "English", "en", new[] { "eng" }); var englishCultureDto = new CultureDto("English", "English", "en", new[] { "eng" });
var localizationManager = new Mock<ILocalizationManager>(MockBehavior.Loose); var localizationManager = new Mock<ILocalizationManager>(MockBehavior.Loose);
localizationManager.Setup(lm => lm.FindLanguageInfo(It.IsRegex(@"en.*", RegexOptions.IgnoreCase))) localizationManager.Setup(lm => lm.FindLanguageInfo(It.IsRegex("en.*", RegexOptions.IgnoreCase)))
.Returns(englishCultureDto); .Returns(englishCultureDto);
_localizationManager = localizationManager.Object; _localizationManager = localizationManager.Object;
@ -79,7 +79,7 @@ public class MediaInfoResolverTests
{ {
// need a media source manager capable of returning something other than file protocol // need a media source manager capable of returning something other than file protocol
var mediaSourceManager = new Mock<IMediaSourceManager>(); var mediaSourceManager = new Mock<IMediaSourceManager>();
mediaSourceManager.Setup(m => m.GetPathProtocol(It.IsRegex(@"http.*"))) mediaSourceManager.Setup(m => m.GetPathProtocol(It.IsRegex("http.*")))
.Returns(MediaProtocol.Http); .Returns(MediaProtocol.Http);
BaseItem.MediaSourceManager = mediaSourceManager.Object; BaseItem.MediaSourceManager = mediaSourceManager.Object;
@ -186,7 +186,7 @@ public class MediaInfoResolverTests
{ {
// need a media source manager capable of returning something other than file protocol // need a media source manager capable of returning something other than file protocol
var mediaSourceManager = new Mock<IMediaSourceManager>(); var mediaSourceManager = new Mock<IMediaSourceManager>();
mediaSourceManager.Setup(m => m.GetPathProtocol(It.IsRegex(@"http.*"))) mediaSourceManager.Setup(m => m.GetPathProtocol(It.IsRegex("http.*")))
.Returns(MediaProtocol.Http); .Returns(MediaProtocol.Http);
BaseItem.MediaSourceManager = mediaSourceManager.Object; BaseItem.MediaSourceManager = mediaSourceManager.Object;