예제 #1
0
        public async Task TestLoadVideoNormalizeTitle()
        {
            var result = await client.LoadVideo("javli6lg24");

            var correct = new Video(
                id: "javli6lg24",
                code: "STARS-126",
                title: "A Big Ass Pantyhose Woman Who Is Exposed So Much That There Is No Plump",
                actresses: new[] { "Koizumi Hinata" },
                genres: new[] { "Cosplay", "Solowork", "Beautiful Girl", "Huge Butt" },
                studio: "SOD Create",
                boxArt: "https://pics.dmm.co.jp/mono/movie/adult/1stars126/1stars126pl.jpg",
                cover: "https://pics.dmm.co.jp/mono/movie/adult/1stars126/1stars126ps.jpg",
                releaseDate: null // TODO
                );

            Assert.AreEqual(result, correct);
        }
        public async Task TestLoadVideoOneActress()
        {
            var result = await JavlibraryClient.LoadVideo("javlio354u").ConfigureAwait(false);

            var correct = new Video(
                id: "javlio354u",
                code: "ABP-002",
                title: "NEW TOKYO Style 01 Aika Phosphorus",
                actresses: new[] { "Aikarin" },
                genres: new[] { "Handjob", "Solowork", "Facials" },
                studio: "Prestige",
                boxArt: "https://pics.dmm.co.jp/mono/movie/adult/118abp002/118abp002pl.jpg",
                cover: "https://pics.dmm.co.jp/mono/movie/adult/118abp002/118abp002ps.jpg",
                releaseDate: null); // TODO

            Assert.AreEqual(result, correct);
        }
        public async Task TestLoadVideoNoActresses()
        {
            var result = await JavlibraryClient.LoadVideo("javliarg3u").ConfigureAwait(false);

            var correct = new Video(
                id: "javliarg3u",
                code: "IPTD-041",
                title: "Goddesses Of The Speed Of Sound 01 RQ'S Cafe",
                actresses: Array.Empty <string>(),
                genres: new[] { "Mini Skirt", "Big T**s", "Slender", "Race Queen", "Digital Mosaic" },
                studio: "IDEA POCKET",
                boxArt: "https://pics.dmm.co.jp/mono/movie/adult/iptd041/iptd041pl.jpg",
                cover: "https://pics.dmm.co.jp/mono/movie/adult/iptd041/iptd041ps.jpg",
                releaseDate: null); // TODO

            Assert.AreEqual(result, correct);
        }
        public async Task TestLoadVideoManyActresses()
        {
            var result = await JavlibraryClient.LoadVideo("javli6bm5q").ConfigureAwait(false);

            var correct = new Video(
                id: "javli6bm5q",
                code: "SDDE-592",
                title: "Room Boundaries-If It Were In This Way, I Would Like It!To",
                actresses: new[] { "Kurata Mao", "Mihara Honoka", "Kururigi Aoi" },
                genres: new[] { "Cosplay", "Planning", "Cum", "Hypnosis" },
                studio: "SOD Create",
                boxArt: "https://pics.dmm.co.jp/mono/movie/adult/1sdde592/1sdde592pl.jpg",
                cover: "https://pics.dmm.co.jp/mono/movie/adult/1sdde592/1sdde592ps.jpg",
                releaseDate: null); // TODO

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

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

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

                result = await JavlibraryClient.SearchFirst(code).ConfigureAwait(false);
            }

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

            return(new MetadataResult <Movie>
            {
                Item = new Movie
                {
                    OriginalTitle = originalTitle,
                    Name = Utility.CreateVideoDisplayName(result.Value),
                    ProviderIds = new Dictionary <string, string> {
                        { "Javlibrary", result.Value.Id }
                    },
                    Studios = new[] { result.Value.Studio },
                    Genres = result.Value.Genres.ToArray(),
                },
                People = CreateActressList(result.Value),
                HasMetadata = true,
            });
        }
        /// <inheritdoc />
        public async Task <IEnumerable <RemoteImageInfo> > GetImages(BaseItem item, CancellationToken cancelToken)
        {
            var id = item.GetProviderId("Javlibrary");

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

            var video = await JavlibraryClient.LoadVideo(id).ConfigureAwait(false);

            return(new RemoteImageInfo[]
            {
                new RemoteImageInfo
                {
                    ProviderName = this.Name,
                    Type = ImageType.Primary,
                    Url = video?.BoxArt,
                },
            });
        }