Exemple #1
0
        public async Task TestSearchFirst()
        {
            var result = await client.SearchFirst("Hiyori Yoshioka");

            var expected = new Actress(
                id: "s-2-0/3806",
                name: "Hiyori Yoshioka",
                birthdate: DateTime.Parse("August 08, 1999"),
                birthplace: "Japan",
                cover: "http://warashi-asian-pornstars.fr/WAPdB-img/pornostars-f/h/i/3806/hiyori-yoshioka/profil-0/large/wapdb-hiyori-yoshioka-pornostar-asiatique.warashi-asian-pornstars.fr.jpg"
                );

            Assert.AreEqual(expected, result);
        }
Exemple #2
0
        public async Task TestSearchFirstFemalePornstar()
        {
            var result = await WarashiClient.SearchFirst("Ruka Aoi").ConfigureAwait(false);

            // Parsing for female-pornstar results isn't done yet.
            var expected = new Actress(
                id: "s-4-1/14028",
                name: "Ruka Aoi - 藍井る加",
                birthdate: null,
                birthplace: null,
                cover: "http://warashi-asian-pornstars.fr/WAPdB-img/pornostars-f/r/u/786/ruka-aoi/preview/mini/wapdb-ruka-aoi-pornostar-asiatique.warashi-asian-pornstars.fr.jpg");

            Assert.AreEqual(expected, result);
        }
        /// <inheritdoc />
        public async Task <MetadataResult <Person> > GetMetadata(PersonLookupInfo info, CancellationToken cancellationToken)
        {
            this.logger.LogInformation("[JellyfinJav] Warashi - Scanning: " + info.Name);

            Api.Actress?actress;
            if (info.ProviderIds.ContainsKey("Warashi"))
            {
                actress = await WarashiClient.LoadActress(info.ProviderIds["Warashi"]).ConfigureAwait(false);
            }
            else
            {
                actress = await WarashiClient.SearchFirst(info.Name).ConfigureAwait(false);
            }

            if (!actress.HasValue)
            {
                return(new MetadataResult <Person>());
            }

            return(new MetadataResult <Person>
            {
                // Changing the actress name but still keeping them associated with
                // their videos will be a challenge.
                Item = new Person
                {
                    ProviderIds = new Dictionary <string, string> {
                        { "Warashi", actress.Value.Id }
                    },
                    PremiereDate = actress.Value.Birthdate,
                    ProductionLocations = new[] { actress.Value.Birthplace }.Where(i => i is string).ToArray(),

                    // Jellyfin will always refresh metadata unless Overview exists.
                    // So giving Overview a zero width character to prevent that.
                    Overview = "\u200B",
                },
                HasMetadata = true,
            });
        }