Beispiel #1
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,
                },
            });
        }
Beispiel #2
0
        public async Task TestSearchFirstLast()
        {
            var results = await WarashiClient.Search("Maria Nagai").ConfigureAwait(false);

            Assert.AreEqual("Maria Nagai", results.ElementAt(0).Name);
            Assert.AreEqual("s-2-0/3743", results.ElementAt(0).Id);
            Assert.AreEqual(
                new Uri("http://warashi-asian-pornstars.fr/WAPdB-img/pornostars-f/m/a/3743/maria-nagai/preview/mini/wapdb-maria-nagai-pornostar-asiatique.warashi-asian-pornstars.fr.jpg"),
                results.ElementAt(0).Cover);
        }
Beispiel #3
0
        public async Task TestSearchLastFirst()
        {
            var results = await WarashiClient.Search("Sasaki Aki").ConfigureAwait(false);

            Assert.AreEqual("Aki Sasaki", results.ElementAt(0).Name);
            Assert.AreEqual("s-2-0/2714", results.ElementAt(0).Id);
            Assert.AreEqual(
                new Uri("http://warashi-asian-pornstars.fr/WAPdB-img/pornostars-f/a/k/2714/aki-sasaki/preview/mini/wapdb-aki-sasaki-pornostar-asiatique.warashi-asian-pornstars.fr.jpg"),
                results.ElementAt(0).Cover);
        }
Beispiel #4
0
        public async Task TestSearchFirst()
        {
            var result = await WarashiClient.SearchFirst("Hiyori Yoshioka").ConfigureAwait(false);

            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);
        }
Beispiel #5
0
        public async Task TestLoadActress()
        {
            var result = await WarashiClient.LoadActress("s-2-0/2714").ConfigureAwait(false);

            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);
        }
 /// <inheritdoc />
 public async Task <IEnumerable <RemoteSearchResult> > GetSearchResults(PersonLookupInfo info, CancellationToken cancelationToken)
 {
     return(from actress in await WarashiClient.Search(info.Name).ConfigureAwait(false)
            select new RemoteSearchResult
     {
         Name = actress.Name,
         ProviderIds = new Dictionary <string, string>
         {
             { "Warashi", actress.Id },
         },
         ImageUrl = actress.Cover?.ToString(),
     });
 }
Beispiel #7
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,
            });
        }
Beispiel #9
0
        public async Task TestLoadActressInvalid()
        {
            var result = await WarashiClient.LoadActress("invalid").ConfigureAwait(false);

            Assert.IsNull(result);
        }
Beispiel #10
0
 public void OneTimeSetup()
 {
     client = new WarashiClient();
 }