diff --git a/Jellyfin.Plugin.JavTube/Constant.cs b/Jellyfin.Plugin.JavTube/Constant.cs index ef9e674..4a1e11a 100644 --- a/Jellyfin.Plugin.JavTube/Constant.cs +++ b/Jellyfin.Plugin.JavTube/Constant.cs @@ -2,7 +2,7 @@ namespace Jellyfin.Plugin.JavTube; public static class Constant { - public const string JavTube = "JavTube"; + // public const string JavTube = "JavTube"; public const string Rating = "JP-18+"; diff --git a/Jellyfin.Plugin.JavTube/Extensions/LogManagerExtension.cs b/Jellyfin.Plugin.JavTube/Extensions/LogManagerExtension.cs index ce35ae4..ce0d31b 100644 --- a/Jellyfin.Plugin.JavTube/Extensions/LogManagerExtension.cs +++ b/Jellyfin.Plugin.JavTube/Extensions/LogManagerExtension.cs @@ -7,7 +7,7 @@ internal static class LogManagerExtension { public static ILogger CreateLogger(this ILogManager logManager) { - return logManager.GetLogger($"{Constant.JavTube}.{typeof(T).Name}"); + return logManager.GetLogger($"{Plugin.Instance.Name}.{typeof(T).Name}"); } } diff --git a/Jellyfin.Plugin.JavTube/ExternalIds/ActorExternalId.cs b/Jellyfin.Plugin.JavTube/ExternalIds/ActorExternalId.cs index 6f0b25f..5aae688 100644 --- a/Jellyfin.Plugin.JavTube/ExternalIds/ActorExternalId.cs +++ b/Jellyfin.Plugin.JavTube/ExternalIds/ActorExternalId.cs @@ -10,13 +10,13 @@ namespace Jellyfin.Plugin.JavTube.ExternalIds; public class ActorExternalId : IExternalId { #if __EMBY__ - public string Name => Constant.JavTube; + public string Name => Plugin.Instance.Name; #else - public string ProviderName => Constant.JavTube; + public string ProviderName => Plugin.Instance.Name; public ExternalIdMediaType? Type => ExternalIdMediaType.Person; #endif - public string Key => Constant.JavTube; + public string Key => Plugin.Instance.Name; public string UrlFormatString => Plugin.Instance.Configuration.Server + "/r/{0}"; diff --git a/Jellyfin.Plugin.JavTube/ExternalIds/MovieExternalId.cs b/Jellyfin.Plugin.JavTube/ExternalIds/MovieExternalId.cs index 27022bc..c8b9e43 100644 --- a/Jellyfin.Plugin.JavTube/ExternalIds/MovieExternalId.cs +++ b/Jellyfin.Plugin.JavTube/ExternalIds/MovieExternalId.cs @@ -10,13 +10,13 @@ namespace Jellyfin.Plugin.JavTube.ExternalIds; public class MovieExternalId : IExternalId { #if __EMBY__ - public string Name => Constant.JavTube; + public string Name => Plugin.Instance.Name; #else - public string ProviderName => Constant.JavTube; + public string ProviderName => Plugin.Instance.Name; public ExternalIdMediaType? Type => ExternalIdMediaType.Movie; #endif - public string Key => Constant.JavTube; + public string Key => Plugin.Instance.Name; public string UrlFormatString => Plugin.Instance.Configuration.Server + "/r/{0}"; diff --git a/Jellyfin.Plugin.JavTube/Plugin.cs b/Jellyfin.Plugin.JavTube/Plugin.cs index 169b3cb..e602b1c 100644 --- a/Jellyfin.Plugin.JavTube/Plugin.cs +++ b/Jellyfin.Plugin.JavTube/Plugin.cs @@ -21,7 +21,7 @@ public class Plugin : BasePlugin, IHasWebPages Instance = this; } - public override string Name => Constant.JavTube; + public override string Name => "JavTube"; public override string Description => "JavTube Plugin for Jellyfin/Emby"; diff --git a/Jellyfin.Plugin.JavTube/Providers/ActorImageProvider.cs b/Jellyfin.Plugin.JavTube/Providers/ActorImageProvider.cs index 083d095..1e8a39a 100644 --- a/Jellyfin.Plugin.JavTube/Providers/ActorImageProvider.cs +++ b/Jellyfin.Plugin.JavTube/Providers/ActorImageProvider.cs @@ -26,10 +26,6 @@ public class ActorImageProvider : BaseProvider, IRemoteImageProvider, IHasOrder // Init } - public int Order => 1; - - public string Name => Constant.JavTube; - #if __EMBY__ public async Task> GetImages(BaseItem item, LibraryOptions libraryOptions, CancellationToken cancellationToken) diff --git a/Jellyfin.Plugin.JavTube/Providers/ActorProvider.cs b/Jellyfin.Plugin.JavTube/Providers/ActorProvider.cs index ffa4a74..f0932d5 100644 --- a/Jellyfin.Plugin.JavTube/Providers/ActorProvider.cs +++ b/Jellyfin.Plugin.JavTube/Providers/ActorProvider.cs @@ -26,10 +26,6 @@ public class ActorProvider : BaseProvider, IRemoteMetadataProvider 1; - - public string Name => Constant.JavTube; - public async Task> GetMetadata(PersonLookupInfo info, CancellationToken cancellationToken) { diff --git a/Jellyfin.Plugin.JavTube/Providers/BaseProvider.cs b/Jellyfin.Plugin.JavTube/Providers/BaseProvider.cs index 0f54c56..441988a 100644 --- a/Jellyfin.Plugin.JavTube/Providers/BaseProvider.cs +++ b/Jellyfin.Plugin.JavTube/Providers/BaseProvider.cs @@ -28,6 +28,10 @@ public abstract class BaseProvider _logger = logger; } #endif + + public int Order => 1; + + public string Name => Plugin.Instance.Name; #if __EMBY__ public Task GetImageResponse(string url, CancellationToken cancellationToken) diff --git a/Jellyfin.Plugin.JavTube/Providers/MovieImageProvider.cs b/Jellyfin.Plugin.JavTube/Providers/MovieImageProvider.cs index 6012259..409b5e7 100644 --- a/Jellyfin.Plugin.JavTube/Providers/MovieImageProvider.cs +++ b/Jellyfin.Plugin.JavTube/Providers/MovieImageProvider.cs @@ -28,10 +28,6 @@ public class ImageProvider : BaseProvider, IRemoteImageProvider, IHasOrder // Init } - public int Order => 1; - - public string Name => Constant.JavTube; - #if __EMBY__ public async Task> GetImages(BaseItem item, LibraryOptions libraryOptions, CancellationToken cancellationToken) @@ -39,7 +35,7 @@ public class ImageProvider : BaseProvider, IRemoteImageProvider, IHasOrder public async Task> GetImages(BaseItem item, CancellationToken cancellationToken) #endif { - var pid = item.GetProviderIdModel(Constant.JavTube); + var pid = item.GetProviderIdModel(Name); if (string.IsNullOrWhiteSpace(pid.Id) || string.IsNullOrWhiteSpace(pid.Provider)) return new List(); diff --git a/Jellyfin.Plugin.JavTube/Providers/MovieProvider.cs b/Jellyfin.Plugin.JavTube/Providers/MovieProvider.cs index 50b7b6c..401a116 100644 --- a/Jellyfin.Plugin.JavTube/Providers/MovieProvider.cs +++ b/Jellyfin.Plugin.JavTube/Providers/MovieProvider.cs @@ -27,14 +27,10 @@ public class MovieProvider : BaseProvider, IRemoteMetadataProvider 1; - - public string Name => Constant.JavTube; - public async Task> GetMetadata(MovieInfo info, CancellationToken cancellationToken) { - var pid = info.GetProviderIdModel(Constant.JavTube); + var pid = info.GetProviderIdModel(Name); if (string.IsNullOrWhiteSpace(pid.Id) || string.IsNullOrWhiteSpace(pid.Provider)) { // Search movie and pick the first result. @@ -42,7 +38,7 @@ public class MovieProvider : BaseProvider, IRemoteMetadataProvider> GetSearchResults(MovieInfo info, CancellationToken cancellationToken) { - var pid = info.GetProviderIdModel(Constant.JavTube); + var pid = info.GetProviderIdModel(Name); if (string.IsNullOrWhiteSpace(pid.Id)) // Search movie by name. pid.Id = info.Name; @@ -132,7 +128,7 @@ public class MovieProvider : BaseProvider, IRemoteMetadataProvider $"{Constant.JavTube}OrganizeGenres"; + public string Key => $"{Plugin.Instance.Name}OrganizeGenres"; public string Name => "Organize Genres"; - public string Description => $"Organize metadata genres provided by {Constant.JavTube} in library."; + public string Description => $"Organize metadata genres provided by {Plugin.Instance.Name} in library."; - public string Category => Constant.JavTube; + public string Category => Plugin.Instance.Name; public IEnumerable GetDefaultTriggers() { @@ -66,10 +66,10 @@ public class OrganizeGenresTask : IScheduledTask { MediaTypes = new[] { MediaType.Video }, #if __EMBY__ - HasAnyProviderId = new[] { Constant.JavTube }, + HasAnyProviderId = new[] { Plugin.Instance.Name }, IncludeItemTypes = new[] { nameof(Movie) }, #else - HasAnyProviderId = new Dictionary { { Constant.JavTube, string.Empty } }, + HasAnyProviderId = new Dictionary { { Plugin.Instance.Name, string.Empty } }, IncludeItemTypes = new[] { BaseItemKind.Movie } #endif }).ToList();