From 501b0019da64da511aff746af86b2270bd9053e6 Mon Sep 17 00:00:00 2001 From: xjasonlyu Date: Mon, 30 May 2022 18:13:45 +0800 Subject: [PATCH] Support update info --- Jellyfin.Plugin.JavTube/ApiClient.cs | 12 ++++++++++++ Jellyfin.Plugin.JavTube/Providers/ActorProvider.cs | 7 ++++++- Jellyfin.Plugin.JavTube/Providers/MovieProvider.cs | 7 ++++++- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/Jellyfin.Plugin.JavTube/ApiClient.cs b/Jellyfin.Plugin.JavTube/ApiClient.cs index 6b90323..2ff6084 100644 --- a/Jellyfin.Plugin.JavTube/ApiClient.cs +++ b/Jellyfin.Plugin.JavTube/ApiClient.cs @@ -105,6 +105,12 @@ public static class ApiClient return await GetActorInfo(id, provider, string.Empty, true, cancellationToken); } + public static async Task GetActorInfo(string id, string provider, bool lazy, + CancellationToken cancellationToken) + { + return await GetActorInfo(id, provider, string.Empty, lazy, cancellationToken); + } + public static async Task GetActorInfo(string id, string provider, string url, bool lazy, CancellationToken cancellationToken) { @@ -124,6 +130,12 @@ public static class ApiClient return await GetMovieInfo(id, provider, string.Empty, language, true, cancellationToken); } + public static async Task GetMovieInfo(string id, string provider, bool lazy, + CancellationToken cancellationToken) + { + return await GetMovieInfo(id, provider, string.Empty, string.Empty, lazy, cancellationToken); + } + public static async Task GetMovieInfo(string id, string provider, string url, string language, bool lazy, CancellationToken cancellationToken) { diff --git a/Jellyfin.Plugin.JavTube/Providers/ActorProvider.cs b/Jellyfin.Plugin.JavTube/Providers/ActorProvider.cs index 1e5e47e..2560c60 100644 --- a/Jellyfin.Plugin.JavTube/Providers/ActorProvider.cs +++ b/Jellyfin.Plugin.JavTube/Providers/ActorProvider.cs @@ -82,8 +82,13 @@ public class ActorProvider : BaseProvider, IRemoteMetadataProvider(); + var searchResults = new List(); + + if (pid.UpdateInfo == true) + searchResults.Add(await ApiClient.GetActorInfo(pid.Id, pid.Provider, false, cancellationToken)); + else + searchResults.AddRange(await ApiClient.SearchActor(pid.Id, pid.Provider, cancellationToken)); - var searchResults = await ApiClient.SearchActor(pid.Id, pid.Provider, cancellationToken); if (!searchResults.Any()) { LogInfo("Actor not found: {0}", pid.Id); diff --git a/Jellyfin.Plugin.JavTube/Providers/MovieProvider.cs b/Jellyfin.Plugin.JavTube/Providers/MovieProvider.cs index e3f032b..cef09ed 100644 --- a/Jellyfin.Plugin.JavTube/Providers/MovieProvider.cs +++ b/Jellyfin.Plugin.JavTube/Providers/MovieProvider.cs @@ -115,8 +115,13 @@ public class MovieProvider : BaseProvider, IRemoteMetadataProvider(); + var searchResults = new List(); + + if (pid.UpdateInfo == true) + searchResults.Add(await ApiClient.GetMovieInfo(pid.Id, pid.Provider, false, cancellationToken)); + else + searchResults.AddRange(await ApiClient.SearchMovie(pid.Id, pid.Provider, cancellationToken)); - var searchResults = await ApiClient.SearchMovie(pid.Id, pid.Provider, cancellationToken); if (!searchResults.Any()) { LogInfo("Movie not found: {0}", pid.Id);