Example #1
0
        public async Task TestLoadActress()
        {
            var result = await client.LoadActress("s-2-0/2714");

            var expected = new Actress(
                id: "s-2-0/2714",
                name: "Aki Sasaki",
                birthdate: DateTime.Parse("December 24, 1979"),
                birthplace: "Japan, Saitama prefecture",
                cover: "http://warashi-asian-pornstars.fr/WAPdB-img/pornostars-f/a/k/2714/aki-sasaki/profil-0/large/wapdb-aki-sasaki-pornostar-asiatique.warashi-asian-pornstars.fr.jpg"
                );

            Assert.AreEqual(expected, result);
        }
Example #2
0
        /// <inheritdoc />
        public async Task <IEnumerable <RemoteImageInfo> > GetImages(BaseItem item, CancellationToken cancelToken)
        {
            var id = item.GetProviderId("Warashi");

            if (string.IsNullOrEmpty(id))
            {
                return(Array.Empty <RemoteImageInfo>());
            }

            var actress = await WarashiClient.LoadActress(id).ConfigureAwait(false);

            if (!actress.HasValue || actress.Value.Cover == null)
            {
                return(Array.Empty <RemoteImageInfo>());
            }

            return(new RemoteImageInfo[]
            {
                new RemoteImageInfo
                {
                    ProviderName = this.Name,
                    Type = ImageType.Primary,
                    Url = actress.Value.Cover,
                },
            });
        }
        /// <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,
            });
        }
Example #4
0
        public async Task TestLoadActressInvalid()
        {
            var result = await WarashiClient.LoadActress("invalid").ConfigureAwait(false);

            Assert.IsNull(result);
        }