public async Task GetMetadata_TvDbLibraryStructure_UsesNameFromLibraryStructureSource(
            string fileStructureSourceName)
        {
            Plugin.Instance.Configuration.LibraryStructureSourceName = SourceNames.TvDb;
            Plugin.Instance.Configuration.FileStructureSourceName    = fileStructureSourceName;

            var seasonInfo = new SeasonInfo
            {
                Name              = "Season Unknown",
                IndexNumber       = 2,
                SeriesProviderIds = new Dictionary <string, string>
                {
                    { SourceNames.AniDb, "959" },
                    { SourceNames.TvDb, "78914" },
                    { SourceNames.AniList, "72" }
                }
            };

            var seasonEntryPoint = new SeasonProviderEntryPoint(this.applicationHost);

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

            result.HasMetadata.Should().BeTrue();
            result.Item.Name.Should().BeEquivalentTo("Season 2");
        }
Example #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);
        }