Esempio n. 1
0
        public void TestFalsePositives2()
        {
            var files = new[]
            {
                "Bad Boys 2006.mkv",
                "Bad Boys 2007.mkv"
            };

            var resolver = GetResolver();

            var result = resolver.ResolveFiles(files);

            Assert.AreEqual(0, result.Stacks.Count);
        }
Esempio n. 2
0
        public void TestFalsePositives3()
        {
            var files = new[]
            {
                "300 (2006).mkv",
                "300 (2007).mkv"
            };

            var resolver = GetResolver();

            var result = resolver.ResolveFiles(files);

            Assert.AreEqual(0, result.Stacks.Count);
        }
        public void TestStackAndExtras()
        {
            // No stacking here because there is no part/disc/etc
            var files = new[]
            {
                "Harry Potter and the Deathly Hallows-trailer.mkv",
                "Harry Potter and the Deathly Hallows.trailer.mkv",
                "Harry Potter and the Deathly Hallows part1.mkv",
                "Harry Potter and the Deathly Hallows part2.mkv",
                "Harry Potter and the Deathly Hallows part3.mkv",
                "Harry Potter and the Deathly Hallows part4.mkv",
                "Batman-deleted.mkv",
                "Batman-sample.mkv",
                "Batman-trailer.mkv",
                "Batman part1.mkv",
                "Batman part2.mkv",
                "Batman part3.mkv",
                "Avengers.mkv",
                "Avengers-trailer.mkv",

                // Despite having a keyword in the name that will return an ExtraType, there's no original video to match it to
                // So this is just a standalone video
                "trailer.mkv",

                // Same as above
                "WillyWonka-trailer.mkv"
            };

            var resolver = GetResolver();

            var result = resolver.Resolve(files.Select(i => new FileMetadata
            {
                IsFolder = false,
                Id = i

            }).ToList()).ToList();

            Assert.AreEqual(5, result.Count);

            Assert.AreEqual(3, result[1].Files.Count);
            Assert.AreEqual(3, result[1].Extras.Count);
            Assert.AreEqual("Batman", result[1].Name);
            
            Assert.AreEqual(4, result[2].Files.Count);
            Assert.AreEqual(2, result[2].Extras.Count);
            Assert.AreEqual("Harry Potter and the Deathly Hallows", result[2].Name);
        }
Esempio n. 4
0
        public void TestSimpleStack()
        {
            var files = new[]
            {
                "Bad Boys (2006) part1.mkv",
                "Bad Boys (2006) part2.mkv",
                "Bad Boys (2006) part3.mkv",
                "Bad Boys (2006) part4.mkv",
                "Bad Boys (2006)-trailer.mkv"
            };

            var resolver = GetResolver();

            var result = resolver.ResolveFiles(files);

            Assert.AreEqual(1, result.Stacks.Count);
            TestStackInfo(result.Stacks[0], "Bad Boys (2006)", 4);
        }
        public void TestWithMetadata()
        {
            var files = new[]
            {
                "300.mkv",
                "300.nfo"
            };

            var resolver = GetResolver();

            var result = resolver.Resolve(files.Select(i => new FileMetadata
            {
                IsFolder = false,
                Id = i

            }).ToList()).ToList();

            Assert.AreEqual(1, result.Count);
        }
Esempio n. 6
0
        public void TestMultiEdition1()
        {
            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-trailer.mp4",
                @"\\movies\X-Men Days of Future Past\X-Men Days of Future Past - [hsbs].mkv"
            };

            var resolver = GetResolver();

            var result = resolver.Resolve(files.Select(i => new FileMetadata
            {
                IsFolder = false,
                Id = i

            }).ToList()).ToList();

            Assert.AreEqual(1, result.Count);
            Assert.AreEqual(1, result[0].Extras.Count);
        }
Esempio n. 7
0
        public void TestMixedExpressions()
        {
            var files = new[]
            {
                "Bad Boys (2006) part1.mkv",
                "Bad Boys (2006) part2.mkv",
                "Bad Boys (2006) part3.mkv",
                "Bad Boys (2006) part4.mkv",
                "Bad Boys (2006)-trailer.mkv",
                "300 (2006) parta.mkv",
                "300 (2006) partb.mkv",
                "300 (2006) partc.mkv",
                "300 (2006) partd.mkv",
                "300 (2006)-trailer.mkv",
                "300a.mkv",
                "300b.mkv",
                "300c.mkv",
                "300-trailer.mkv"
            };

            var resolver = GetResolver();

            var result = resolver.ResolveFiles(files);

            Assert.AreEqual(3, result.Stacks.Count);

            TestStackInfo(result.Stacks[0], "300 (2006)", 4);
            TestStackInfo(result.Stacks[1], "300", 3);
            TestStackInfo(result.Stacks[2], "Bad Boys (2006)", 4);
        }
Esempio n. 8
0
        public void TestFalsePositive()
        {
            var files = new[]
            {
                "300a.mkv",
                "300b.mkv",
                "300c.mkv",
                "300-trailer.mkv"
            };

            var resolver = GetResolver();

            var result = resolver.ResolveFiles(files);

            Assert.AreEqual(1, result.Stacks.Count);

            TestStackInfo(result.Stacks[0], "300", 3);
        }
Esempio n. 9
0
        public void TestFailSequence()
        {
            var files = new[]
            {
                "300 part1.mkv",
                "300 part2.mkv",
                "Avatar",
                "Avengers part1.mkv",
                "Avengers part2.mkv",
                "Avengers part3.mkv"
            };

            var resolver = GetResolver();

            var result = resolver.ResolveFiles(files);

            Assert.AreEqual(2, result.Stacks.Count);

            TestStackInfo(result.Stacks[0], "300", 2);
            TestStackInfo(result.Stacks[1], "Avengers", 3);
        }
        public void TestDifferentNames()
        {
            var files = new[]
            {
                "Looper (2012)-trailer.mkv",
                "Looper.2012.bluray.720p.x264.mkv"
            };

            var resolver = GetResolver();

            var result = resolver.Resolve(files.Select(i => new FileMetadata
            {
                IsFolder = false,
                Id = i

            }).ToList()).ToList();

            Assert.AreEqual(1, result.Count);
        }
        public void TestExtrasByFolderName()
        {
            var files = new[]
            {
                @"\\Movies\Top Gun (1984)\movie.mp4",
                @"\\Movies\Top Gun (1984)\Top Gun (1984)-trailer.mp4",
                @"\\Movies\Top Gun (1984)\Top Gun (1984)-trailer2.mp4",
                @"trailer.mp4"
            };

            var resolver = GetResolver();

            var result = resolver.Resolve(files.Select(i => new FileMetadata
            {
                IsFolder = false,
                Id = i

            }).ToList()).ToList();

            Assert.AreEqual(1, result.Count);
        }
Esempio n. 12
0
        public void TestNamesWithoutParts()
        {
            // No stacking here because there is no part/disc/etc
            var files = new[]
            {
                "Harry Potter and the Deathly Hallows.mkv",
                "Harry Potter and the Deathly Hallows 1.mkv",
                "Harry Potter and the Deathly Hallows 2.mkv",
                "Harry Potter and the Deathly Hallows 3.mkv",
                "Harry Potter and the Deathly Hallows 4.mkv"
            };

            var resolver = GetResolver();

            var result = resolver.ResolveFiles(files);

            Assert.AreEqual(0, result.Stacks.Count);
        }
Esempio n. 13
0
        public void TestMultiDiscs()
        {
            // No stacking here because there is no part/disc/etc
            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 02)"
            };

            var resolver = GetResolver();

            var result = resolver.ResolveDirectories(files);

            Assert.AreEqual(1, result.Stacks.Count);
            Assert.AreEqual(2, result.Stacks[0].Files.Count);
        }
        public void TestPoundSign()
        {
            // These should be considered separate, unrelated videos
            var files = new[]
            {
                @"My movie #1.mp4",
                @"My movie #2.mp4"
            };

            var resolver = GetResolver();

            var result = resolver.Resolve(files.Select(i => new FileMetadata
            {
                IsFolder = true,
                Id = i

            }).ToList()).ToList();

            Assert.AreEqual(2, result.Count);
        }
Esempio n. 15
0
        public void TestDirtyNames()
        {
            var files = new[]
            {
                "Bad Boys (2006).part1.stv.unrated.multi.1080p.bluray.x264-rough.mkv",
                "Bad Boys (2006).part2.stv.unrated.multi.1080p.bluray.x264-rough.mkv",
                "Bad Boys (2006).part3.stv.unrated.multi.1080p.bluray.x264-rough.mkv",
                "Bad Boys (2006).part4.stv.unrated.multi.1080p.bluray.x264-rough.mkv",
                "Bad Boys (2006)-trailer.mkv"
            };

            var resolver = GetResolver();

            var result = resolver.ResolveFiles(files);

            Assert.AreEqual(1, result.Stacks.Count);
            TestStackInfo(result.Stacks[0], "Bad Boys (2006).stv.unrated.multi.1080p.bluray.x264-rough", 4);
        }
        public void TestFourSisters()
        {
            var files = new[]
            {
                @"Four Sisters and a Wedding - A.avi",
                @"Four Sisters and a Wedding - B.avi"
            };

            var resolver = GetResolver();

            var result = resolver.Resolve(files.Select(i => new FileMetadata
            {
                IsFolder = false,
                Id = i

            }).ToList()).ToList();

            Assert.AreEqual(1, result.Count);
        }
        public void TestMovieTrailer()
        {
            var files = new[]
            {
                @"\\Server\Despicable Me\Despicable Me (2010).mkv",
                @"\\Server\Despicable Me\movie-trailer.mkv"
            };

            var resolver = GetResolver();

            var result = resolver.Resolve(files.Select(i => new FileMetadata
            {
                IsFolder = false,
                Id = i

            }).ToList()).ToList();

            Assert.AreEqual(1, result.Count);
        }
        public void TestColony()
        {
            var files = new[]
            {
                @"The Colony.mkv"
            };

            var resolver = GetResolver();

            var result = resolver.Resolve(files.Select(i => new FileMetadata
            {
                IsFolder = false,
                Id = i

            }).ToList()).ToList();

            Assert.AreEqual(1, result.Count);
        }
        public void TestArgumentOutOfRangeException()
        {
            var files = new[]
            {
                @"\\nas-markrobbo78\Videos\INDEX HTPC\Movies\Watched\3 - ACTION\Argo (2012)\movie.mkv"
            };

            var resolver = GetResolver();

            var result = resolver.Resolve(files.Select(i => new FileMetadata
            {
                IsFolder = false,
                Id = i

            }).ToList()).ToList();

            Assert.AreEqual(1, result.Count);
        }
        public void TestDoubleTags()
        {
            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 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 cd2.avi"
            };

            var resolver = GetResolver();

            var result = resolver.Resolve(files.Select(i => new FileMetadata
            {
                IsFolder = false,
                Id = i

            }).ToList()).ToList();

            Assert.AreEqual(2, result.Count);
        }
Esempio n. 21
0
        public void TestAlphaLimitOfFour()
        {
            var files = new[]
            {
                "300 (2006) parta.mkv",
                "300 (2006) partb.mkv",
                "300 (2006) partc.mkv",
                "300 (2006) partd.mkv",
                "300 (2006) parte.mkv",
                "300 (2006) partf.mkv",
                "300 (2006) partg.mkv",
                "300 (2006)-trailer.mkv"
            };

            var resolver = GetResolver();

            var result = resolver.ResolveFiles(files);

            Assert.AreEqual(1, result.Stacks.Count);

            TestStackInfo(result.Stacks[0], "300 (2006)", 4);
        }
        public void TestMultiDisc()
        {
            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 2"
            };

            var resolver = GetResolver();

            var result = resolver.Resolve(files.Select(i => new FileMetadata
            {
                IsFolder = true,
                Id = i

            }).ToList()).ToList();

            Assert.AreEqual(1, result.Count);
        }
Esempio n. 23
0
        public void TestMixed()
        {
            var files = new[]
            {
                new FileMetadata{Id = "Bad Boys (2006) part1.mkv", IsFolder = false},
                new FileMetadata{Id = "Bad Boys (2006) part2.mkv", IsFolder = false},
                new FileMetadata{Id = "300 (2006) part2", IsFolder = true},
                new FileMetadata{Id = "300 (2006) part3", IsFolder = true},
                new FileMetadata{Id = "300 (2006) part1", IsFolder = true}
            };

            var resolver = GetResolver();

            var result = resolver.Resolve(files);

            Assert.AreEqual(2, result.Stacks.Count);
            TestStackInfo(result.Stacks[0], "300 (2006)", 3);
            TestStackInfo(result.Stacks[1], "Bad Boys (2006)", 2);
        }
Esempio n. 24
0
        public void TestNumberedFiles()
        {
            var files = new[]
            {
                "Bad Boys (2006).mkv",
                "Bad Boys (2006) 1.mkv",
                "Bad Boys (2006) 2.mkv",
                "Bad Boys (2006) 3.mkv",
                "Bad Boys (2006)-trailer.mkv"
            };

            var resolver = GetResolver();

            var result = resolver.ResolveFiles(files);

            Assert.AreEqual(0, result.Stacks.Count);
        }
Esempio n. 25
0
        public void TestNumbersAppearingBeforePartNumber()
        {
            // No stacking here because there is no part/disc/etc
            var files = new[]
            {
                "Neverland (2011)[720p][PG][Voted 6.5][Family-Fantasy]part1.mkv",
                "Neverland (2011)[720p][PG][Voted 6.5][Family-Fantasy]part2.mkv"
            };

            var resolver = GetResolver();

            var result = resolver.ResolveFiles(files);

            Assert.AreEqual(1, result.Stacks.Count);
            Assert.AreEqual(2, result.Stacks[0].Files.Count);
        }
Esempio n. 26
0
        public void TestMixedExpressionsNotAllowed()
        {
            var files = new[]
            {
                "Bad Boys (2006) part1.mkv",
                "Bad Boys (2006) part2.mkv",
                "Bad Boys (2006) part3.mkv",
                "Bad Boys (2006) parta.mkv",
                "Bad Boys (2006)-trailer.mkv"
            };

            var resolver = GetResolver();

            var result = resolver.ResolveFiles(files);

            Assert.AreEqual(1, result.Stacks.Count);
            TestStackInfo(result.Stacks[0], "Bad Boys (2006)", 3);
        }
        public void TestSeparateFiles()
        {
            // These should be considered separate, unrelated videos
            var files = new[]
            {
                "My video 1.mkv",
                "My video 2.mkv",
                "My video 3.mkv",
                "My video 4.mkv",
                "My video 5.mkv"
            };

            var resolver = GetResolver();

            var result = resolver.Resolve(files.Select(i => new FileMetadata
            {
                IsFolder = false,
                Id = i

            }).ToList()).ToList();

            Assert.AreEqual(5, result.Count);
        }
Esempio n. 28
0
        public void TestDirectories()
        {
            var files = new[]
            {
                "blah blah - cd 1",
                "blah blah - cd 2"
            };

            var resolver = GetResolver();

            var result = resolver.ResolveDirectories(files);

            Assert.AreEqual(1, result.Stacks.Count);
            TestStackInfo(result.Stacks[0], "blah blah", 2);
        }
Esempio n. 29
0
        public void TestStackName()
        {
            var files = new[]
            {
                "d:\\movies\\300 2006 part1.mkv",
                "d:\\movies\\300 2006 part2.mkv"
            };

            var resolver = GetResolver();

            var result = resolver.ResolveFiles(files);

            Assert.AreEqual(1, result.Stacks.Count);
            TestStackInfo(result.Stacks[0], "300 2006", 2);
        }
        public void TestStackedWithTrailer2()
        {
            var files = new[]
            {
                @"No (2012) part1.mp4",
                @"No (2012) part2.mp4",
                @"No (2012)-trailer.mp4"
            };

            var resolver = GetResolver();

            var result = resolver.Resolve(files.Select(i => new FileMetadata
            {
                IsFolder = false,
                Id = i

            }).ToList()).ToList();

            Assert.AreEqual(1, result.Count);
        }