public async Task GetMetadata_TvDbLibraryStructure_TvDbFileStructure_GetsMetadata(EpisodeInfo episodeInfo)
        {
            Plugin.Instance.Configuration.LibraryStructureSourceName = SourceNames.TvDb;
            Plugin.Instance.Configuration.FileStructureSourceName    = SourceNames.TvDb;

            var episodeEntryPoint = new EpisodeProviderEntryPoint(this.applicationHost);

            var result = await episodeEntryPoint.GetMetadata(episodeInfo, CancellationToken.None);

            result.HasMetadata.Should().BeTrue();
            result.Item.Name.Should().BeEquivalentTo("The Man From The South / A Fruitless Lunchtime");
            result.Item.PremiereDate.Should().Be(new DateTime(2003, 08, 26));
            result.Item.Overview.Should().BeEquivalentTo(@"The Man From The South:
A secret admirer leaves a love letter in Sousuke's shoe locker. Instead of finding the letter, he deduces that his locker was tampered with and promptly blows it up. From its fragments, Sousuke misinterprets the letter as a death threat and confronts his ""stalker"".

A Fruitless Lunchtime:
After Sousuke causes a panic at the school's bread stand, he and Kaname have to fill in for the stand's lunchtime duties, which raises the ire of Mr. Kogure, the physical education teacher. He attempts to sabotage their bread, but falls for Sousuke's booby traps, expecting that someone would tamper the bread."
                                                         );

            result.Item.ProviderIds.Should().BeEquivalentTo(new Dictionary <string, string>
            {
                { SourceNames.AniDb, "10407" },
                { SourceNames.TvDb, "1973471" }
            });
            result.Item.RunTimeTicks.Should().Be(15000000000L);
            result.Item.IndexNumber.Should().Be(1);
            result.Item.ParentIndexNumber.Should().Be(0);
            result.Item.Studios.Should().BeEquivalentTo(new[] { "Kyoto Animation" });
            result.Item.Genres.Should().BeEquivalentTo(
                new[]
            {
                "Anime",
                "Present",
                "Earth",
                "Slapstick",
                "Japan"
            });
            result.Item.Tags.Should().BeEquivalentTo(
                new[]
            {
                "Asia",
                "Comedy",
                "High School",
                "School Life",
                "Action"
            });
        }
Esempio n. 2
0
        public async Task GetMetadata_AniDbLibraryStructure_UsesNameFromTvDBFileStructureSource()
        {
            Plugin.Instance.Configuration.LibraryStructureSourceName = SourceNames.AniDb;
            Plugin.Instance.Configuration.FileStructureSourceName    = SourceNames.TvDb;

            var seriesInfo = new SeriesInfo
            {
                Name = "Haikyu!!"
            };

            var seriesEntryPoint = new SeriesProviderEntryPoint(this.applicationHost);

            var resultSeries = await seriesEntryPoint.GetMetadata(seriesInfo, CancellationToken.None);

            var seasonInfo = new SeasonInfo
            {
                Name              = "Season 01",
                IndexNumber       = 1,
                SeriesProviderIds = { { resultSeries.Item.ProviderIds.First().Key, resultSeries.Item.ProviderIds.First().Value } }
            };
            var seasonInfo2 = new SeasonInfo
            {
                Name              = "Season 02",
                IndexNumber       = 2,
                SeriesProviderIds = { { resultSeries.Item.ProviderIds.First().Key, resultSeries.Item.ProviderIds.First().Value } }
            };


            var seasonEntryPoint = new SeasonProviderEntryPoint(this.applicationHost);

            var resultSeason1 = await seasonEntryPoint.GetMetadata(seasonInfo, CancellationToken.None);

            var resultSeason2 = await seasonEntryPoint.GetMetadata(seasonInfo2, CancellationToken.None);

            var episodeEntryPoint = new EpisodeProviderEntryPoint(this.applicationHost);

            var episodeInfo = new EpisodeInfo
            {
                Name              = "Haikyu.S02E02.1080p.HDTV-HorribleSubs",
                IndexNumber       = 2,
                ParentIndexNumber = 2,
                SeriesProviderIds =
                {
                    { resultSeries.Item.ProviderIds.Last().Key, resultSeries.Item.ProviderIds.Last().Value }
                }
            };
            var resultEpisode11 = await episodeEntryPoint.GetMetadata(episodeInfo, CancellationToken.None);

            resultSeries.HasMetadata.Should().BeTrue();
            resultSeries.Item.Name.Should().BeEquivalentTo("Haikyuu!!");
            resultSeries.Item.AirDays.Should().BeEquivalentTo(new[] { DayOfWeek.Saturday });
            resultSeries.Item.AirTime.Should().BeEquivalentTo("");
            resultSeries.Item.PremiereDate.Should().Be(new DateTime(2003, 08, 26));
            resultSeries.Item.EndDate.Should().Be(new DateTime(2003, 11, 18));
            resultSeries.Item.Overview.Should().BeEquivalentTo(@"It is back-to-school mayhem with Chidori Kaname and her battle-hardened classmate Sagara Sousuke as they encounter more misadventures in and out of Jindai High School. But when Kaname gets into some serious trouble, Sousuke takes the guise of Bonta-kun — the gun-wielding, butt-kicking mascot. And while he struggles to continue living as a normal teenager, Sousuke also has to deal with protecting his superior officer Teletha Testarossa, who has decided to take a vacation from Mithril and spend a couple of weeks as his and Kaname`s classmate.
Source: ANN
Note: Because of a then current kidnapping event, TV Tokyo did not broadcast what were supposed to be part 2 of episode 1 (A Hostage with No Compromises) and part 1 of episode 2 (Hostility Passing-By). A Hostage with No Compromises was replaced by part 2 of episode 2 (A Fruitless Lunchtime) and thus, episode 2 was skipped, leaving the episode count at 11. The DVD release contained all the episodes in the intended order.");
            resultSeries.Item.Studios.Should().BeEquivalentTo(new[] { "Kyoto Animation" });
            resultSeries.Item.Genres.Should().BeEquivalentTo(new[] { "Anime", "Present", "Earth", "Slapstick", "Japan" });
            resultSeries.Item.Tags.Should().BeEquivalentTo(new[] { "Asia", "Comedy", "High School", "School Life", "Action" });
            resultSeries.Item.CommunityRating.Should().Be(8.22f);
            resultSeries.Item.ProviderIds.Should().BeEquivalentTo(
                new Dictionary <string, string>
            {
                { SourceNames.AniDb, "959" },
                { SourceNames.TvDb, "78914" }
            });
            resultSeries.People.Should().HaveCount(55);
        }
        public async Task GetMetadata_TvDbLibraryStructure_TvDbFileStructure_GetsMetadata(EpisodeInfo episodeInfo)
        {
            Plugin.Instance.Configuration.LibraryStructureSourceName = SourceNames.TvDb;
            Plugin.Instance.Configuration.FileStructureSourceName    = SourceNames.TvDb;

            var episodeEntryPoint = new EpisodeProviderEntryPoint(_applicationHost);

            var result = await episodeEntryPoint.GetMetadata(episodeInfo, CancellationToken.None);

            result.HasMetadata.Should().BeTrue();
            result.Item.Should()
            .BeEquivalentTo(new Episode
            {
                Name         = "The Man From The South / A Fruitless Lunchtime",
                PremiereDate = new DateTime(2003, 08, 26),
                Overview     =
                    @"The Man From The South:
A secret admirer leaves a love letter in Sousuke's shoe locker. Instead of finding the letter, he deduces that his locker was tampered with and promptly blows it up. From its fragments, Sousuke misinterprets the letter as a death threat and confronts his ""stalker"".

A Fruitless Lunchtime:
After Sousuke causes a panic at the school's bread stand, he and Kaname have to fill in for the stand's lunchtime duties, which raises the ire of Mr. Kogure, the physical education teacher. He attempts to sabotage their bread, but falls for Sousuke's booby traps, expecting that someone would tamper the bread.",

                CommunityRating = 8.99f,
                ProviderIds     = new Dictionary <string, string>
                {
                    { SourceNames.AniDb, "10407" },
                    { SourceNames.TvDb, "1973471" }
                },
                RunTimeTicks      = 15000000000L,
                IndexNumber       = 1,
                ParentIndexNumber = 0,
                Studios           = new[] { "Kyoto Animation" },
                Genres            = new List <string>
                {
                    "Anime",
                    "Present",
                    "Earth",
                    "Slapstick",
                    "Japan"
                },
                Tags = new[]
                {
                    "Asia",
                    "Comedy",
                    "High School",
                    "School Life",
                    "Action"
                }
            },
                            o => o.Excluding(s => s.DisplayPreferencesId)
                            .Excluding(s => s.SortName)
                            .Excluding(s => s.SupportsRemoteImageDownloading)
                            .Excluding(s => s.IsMissingEpisode)
                            .Excluding(s => s.SourceType)
                            .Excluding(s => s.IsCompleteMedia)
                            .Excluding(s => s.ContainingFolderPath)
                            .Excluding(s => s.FileNameWithoutExtension)
                            .Excluding(s => s.IsOwnedItem)
                            .Excluding(s => s.LocationType)
                            .Excluding(s => s.SupportsLocalMetadata)
                            .Excluding(s => s.PhysicalLocations)
                            .Excluding(s => s.EnableMediaSourceDisplay));
        }