예제 #1
0
        public async Task TestLoadVideoNoActress()
        {
            var expected = new Video(
                id: "njvr00023",
                code: "NJVR-023",
                title: "[VR] The Horn Dogs Chose My Apartment To Be Their F**k Pad. My Friend Was A Nampa Artist And He Brought Over Tsubasa-chan For Some Lotion Lathered Slick And Slippery F*****g",
                actresses: Array.Empty <string>(),
                genres: new[] { "Beautiful Girl", "Big T**s", "Threesome / Foursome", "Lotion", "POV", "VR Exclusive" },
                studio: "Nanpa JAPAN",
                boxArt: "https://pics.r18.com/digital/video/njvr00023/njvr00023pl.jpg",
                cover: "https://pics.r18.com/digital/video/njvr00023/njvr00023ps.jpg",
                releaseDate: DateTime.Parse("2019-07-26"));

            var result = await R18Client.LoadVideo("njvr00023").ConfigureAwait(false);

            Assert.AreEqual(expected, result);
        }
예제 #2
0
        public async Task TestLoadVideo()
        {
            var expected = new Video(
                id: "ssni00643",
                code: "SSNI-643",
                title: "A Woman With Divine Titties Lala Anzai Her Adult Video Debut Miraculous Huge T**s A 7-Tit-Jamming Special",
                actresses: new[] { "Rara Anzai" },
                genres: new[] { "Big T**s", "Big T**s Lover", "Featured Actress", "Titty F**k", "Debut", "Minimal Mosaic", "Hi-Def" },
                studio: "S1 NO.1 STYLE",
                boxArt: "https://pics.r18.com/digital/video/ssni00643/ssni00643pl.jpg",
                cover: "https://pics.r18.com/digital/video/ssni00643/ssni00643ps.jpg",
                releaseDate: DateTime.Parse("2019-11-30 10:00:59"));

            var result = await R18Client.LoadVideo("ssni00643").ConfigureAwait(false);

            Assert.AreEqual(expected, result);
        }
예제 #3
0
        public async Task TestLoadVideo()
        {
            var expected = new Video(
                id: "118abp00925",
                code: "ABP-925",
                title: "You Can Really F**k These Girls?! - The Legendary Pink Salon 13 - Get Your Fill Of A Tall Girl With Big T**s!",
                actresses: new[] { "Reina Kashima" },
                genres: new[] { "Tall Girl", "Featured Actress", "Cosplay", "Creampie", "Sex Toys", "Hi-Def" },
                studio: "Prestige",
                boxArt: "https://pics.r18.com/digital/video/118abp00925/118abp00925pl.jpg",
                cover: "https://pics.r18.com/digital/video/118abp00925/118abp00925ps.jpg",
                releaseDate: DateTime.Parse("2019-11-22"));

            var result = await R18Client.LoadVideo("118abp00925").ConfigureAwait(false);

            Assert.AreEqual(expected, result);
        }
예제 #4
0
        public async Task TestSearchFirst()
        {
            var expected = new Video(
                id: "mvsd00282",
                code: "MVSD-282",
                title: "Rei Mizuna's Three Hole Rape Fan Thanksgiving",
                actresses: new[] { "Rei Mizuna" },
                genres: new[] { "Orgy", "Featured Actress", "Creampie", "Anal Play", "Cum Swallowing", "Digital Mosaic", "Hi-Def" },
                studio: "M's Video Group",
                boxArt: "https://pics.r18.com/digital/video/mvsd00282/mvsd00282pl.jpg",
                cover: "https://pics.r18.com/digital/video/mvsd00282/mvsd00282ps.jpg",
                releaseDate: DateTime.Parse("2015-12-12"));

            var result = await R18Client.SearchFirst("MVSD-282").ConfigureAwait(false);

            Assert.AreEqual(expected, result);
        }
예제 #5
0
        /// <inheritdoc />
        public async Task <MetadataResult <Movie> > GetMetadata(MovieInfo info, CancellationToken cancelToken)
        {
            var originalTitle = Utility.GetVideoOriginalTitle(info, this.libraryManager);

            info.Name = originalTitle;

            this.logger.LogInformation("[JellyfinJav] R18 - Scanning: " + originalTitle);

            Api.Video?video;
            if (info.ProviderIds.ContainsKey("R18"))
            {
                video = await R18Client.LoadVideo(info.ProviderIds["R18"]).ConfigureAwait(false);
            }
            else
            {
                var code = Utility.ExtractCodeFromFilename(originalTitle);
                if (code is null)
                {
                    return(new MetadataResult <Movie>());
                }

                video = await R18Client.SearchFirst(code).ConfigureAwait(false);
            }

            if (!video.HasValue)
            {
                return(new MetadataResult <Movie>());
            }

            return(new MetadataResult <Movie>
            {
                Item = new Movie
                {
                    OriginalTitle = info.Name,
                    Name = Utility.CreateVideoDisplayName(video.Value),
                    PremiereDate = video.Value.ReleaseDate,
                    ProviderIds = new Dictionary <string, string> {
                        { "R18", video.Value.Id }
                    },
                    Studios = new[] { video.Value.Studio },
                    Genres = video.Value.Genres.ToArray(),
                },
                People = CreateActressList(video.Value),
                HasMetadata = true,
            });
        }
예제 #6
0
        /// <inheritdoc />
        public async Task <IEnumerable <RemoteSearchResult> > GetSearchResults(MovieInfo info, CancellationToken cancelToken)
        {
            var javCode = Utility.ExtractCodeFromFilename(info.Name);

            if (string.IsNullOrEmpty(javCode))
            {
                return(Array.Empty <RemoteSearchResult>());
            }

            return(from video in await R18Client.Search(javCode).ConfigureAwait(false)
                   select new RemoteSearchResult
            {
                Name = video.Code,
                ProviderIds = new Dictionary <string, string>
                {
                    { "R18", video.Id },
                },
                ImageUrl = video.Cover?.ToString(),
            });
        }
예제 #7
0
        public async Task TestLoadVideoInvalid()
        {
            var result = await R18Client.LoadVideo("invalid").ConfigureAwait(false);

            Assert.AreEqual(null, result);
        }
예제 #8
0
        public async Task TestSearchFirstNone()
        {
            var result = await R18Client.SearchFirst("noresult").ConfigureAwait(false);

            Assert.AreEqual(null, result);
        }
예제 #9
0
        public async Task TestSearchNone()
        {
            var results = await R18Client.Search("noresult").ConfigureAwait(false);

            Assert.AreEqual(0, results.Count());
        }
예제 #10
0
        public async Task TestSearchMany()
        {
            var results = await R18Client.Search("abp").ConfigureAwait(false);

            Assert.AreEqual(30, results.Count());
        }
예제 #11
0
 public void OneTimeSetup()
 {
     client = new R18Client();
 }