From 8740f3d154b409ed83f5eb7dd07c82bd520327d1 Mon Sep 17 00:00:00 2001 From: Shadowghost Date: Sat, 16 May 2026 18:51:30 +0200 Subject: Move ComicVine and GoogleBooks ExternalUrl providers to MediaBrowser.Providers.Books --- .../Books/ComicVine/ComicVineExternalId.cs | 23 +++++++++++ .../ComicVine/ComicVineExternalUrlProvider.cs | 28 ++++++++++++++ .../Books/ComicVine/ComicVinePersonExternalId.cs | 23 +++++++++++ .../Books/GoogleBooks/GoogleBooksExternalId.cs | 23 +++++++++++ .../GoogleBooks/GoogleBooksExternalUrlProvider.cs | 25 ++++++++++++ .../MediaBrowser.Providers.csproj | 12 ------ .../Plugins/ComicVine/ComicVineExternalId.cs | 23 ----------- .../ComicVine/ComicVineExternalUrlProvider.cs | 28 -------------- .../Plugins/ComicVine/ComicVinePersonExternalId.cs | 23 ----------- .../ComicVine/Configuration/PluginConfiguration.cs | 10 ----- MediaBrowser.Providers/Plugins/ComicVine/Plugin.cs | 45 ---------------------- .../ComicVine/jellyfin-plugin-comicvine.svg | 16 -------- .../Configuration/PluginConfiguration.cs | 10 ----- .../Plugins/GoogleBooks/GoogleBooksExternalId.cs | 23 ----------- .../GoogleBooks/GoogleBooksExternalUrlProvider.cs | 25 ------------ .../Plugins/GoogleBooks/Plugin.cs | 45 ---------------------- .../GoogleBooks/jellyfin-plugin-googlebooks.svg | 18 --------- .../ComicVineExternalUrlProviderTests.cs | 2 +- .../GoogleBooksExternalUrlProviderTests.cs | 2 +- 19 files changed, 124 insertions(+), 280 deletions(-) create mode 100644 MediaBrowser.Providers/Books/ComicVine/ComicVineExternalId.cs create mode 100644 MediaBrowser.Providers/Books/ComicVine/ComicVineExternalUrlProvider.cs create mode 100644 MediaBrowser.Providers/Books/ComicVine/ComicVinePersonExternalId.cs create mode 100644 MediaBrowser.Providers/Books/GoogleBooks/GoogleBooksExternalId.cs create mode 100644 MediaBrowser.Providers/Books/GoogleBooks/GoogleBooksExternalUrlProvider.cs delete mode 100644 MediaBrowser.Providers/Plugins/ComicVine/ComicVineExternalId.cs delete mode 100644 MediaBrowser.Providers/Plugins/ComicVine/ComicVineExternalUrlProvider.cs delete mode 100644 MediaBrowser.Providers/Plugins/ComicVine/ComicVinePersonExternalId.cs delete mode 100644 MediaBrowser.Providers/Plugins/ComicVine/Configuration/PluginConfiguration.cs delete mode 100644 MediaBrowser.Providers/Plugins/ComicVine/Plugin.cs delete mode 100644 MediaBrowser.Providers/Plugins/ComicVine/jellyfin-plugin-comicvine.svg delete mode 100644 MediaBrowser.Providers/Plugins/GoogleBooks/Configuration/PluginConfiguration.cs delete mode 100644 MediaBrowser.Providers/Plugins/GoogleBooks/GoogleBooksExternalId.cs delete mode 100644 MediaBrowser.Providers/Plugins/GoogleBooks/GoogleBooksExternalUrlProvider.cs delete mode 100644 MediaBrowser.Providers/Plugins/GoogleBooks/Plugin.cs delete mode 100644 MediaBrowser.Providers/Plugins/GoogleBooks/jellyfin-plugin-googlebooks.svg diff --git a/MediaBrowser.Providers/Books/ComicVine/ComicVineExternalId.cs b/MediaBrowser.Providers/Books/ComicVine/ComicVineExternalId.cs new file mode 100644 index 0000000000..e2e785eaca --- /dev/null +++ b/MediaBrowser.Providers/Books/ComicVine/ComicVineExternalId.cs @@ -0,0 +1,23 @@ +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Providers; +using MediaBrowser.Model.Entities; +using MediaBrowser.Model.Providers; + +namespace MediaBrowser.Providers.Books.ComicVine +{ + /// + public class ComicVineExternalId : IExternalId + { + /// + public string ProviderName => "Comic Vine"; + + /// + public string Key => "ComicVine"; + + /// + public ExternalIdMediaType? Type => null; + + /// + public bool Supports(IHasProviderIds item) => item is Book; + } +} diff --git a/MediaBrowser.Providers/Books/ComicVine/ComicVineExternalUrlProvider.cs b/MediaBrowser.Providers/Books/ComicVine/ComicVineExternalUrlProvider.cs new file mode 100644 index 0000000000..a8450ec599 --- /dev/null +++ b/MediaBrowser.Providers/Books/ComicVine/ComicVineExternalUrlProvider.cs @@ -0,0 +1,28 @@ +using System.Collections.Generic; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Providers; +using MediaBrowser.Model.Entities; + +namespace MediaBrowser.Providers.Books.ComicVine; + +/// +public class ComicVineExternalUrlProvider : IExternalUrlProvider +{ + /// + public string Name => "Comic Vine"; + + /// + public IEnumerable GetExternalUrls(BaseItem item) + { + if (item.TryGetProviderId("ComicVine", out var externalId)) + { + switch (item) + { + case Person: + case Book: + yield return $"https://comicvine.gamespot.com/{externalId}"; + break; + } + } + } +} diff --git a/MediaBrowser.Providers/Books/ComicVine/ComicVinePersonExternalId.cs b/MediaBrowser.Providers/Books/ComicVine/ComicVinePersonExternalId.cs new file mode 100644 index 0000000000..f625fb9649 --- /dev/null +++ b/MediaBrowser.Providers/Books/ComicVine/ComicVinePersonExternalId.cs @@ -0,0 +1,23 @@ +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Providers; +using MediaBrowser.Model.Entities; +using MediaBrowser.Model.Providers; + +namespace MediaBrowser.Providers.Books.ComicVine +{ + /// + public class ComicVinePersonExternalId : IExternalId + { + /// + public string ProviderName => "Comic Vine"; + + /// + public string Key => "ComicVine"; + + /// + public ExternalIdMediaType? Type => ExternalIdMediaType.Person; + + /// + public bool Supports(IHasProviderIds item) => item is Person; + } +} diff --git a/MediaBrowser.Providers/Books/GoogleBooks/GoogleBooksExternalId.cs b/MediaBrowser.Providers/Books/GoogleBooks/GoogleBooksExternalId.cs new file mode 100644 index 0000000000..aac8cdff65 --- /dev/null +++ b/MediaBrowser.Providers/Books/GoogleBooks/GoogleBooksExternalId.cs @@ -0,0 +1,23 @@ +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Providers; +using MediaBrowser.Model.Entities; +using MediaBrowser.Model.Providers; + +namespace MediaBrowser.Providers.Books.GoogleBooks +{ + /// + public class GoogleBooksExternalId : IExternalId + { + /// + public string ProviderName => "Google Books"; + + /// + public string Key => "GoogleBooks"; + + /// + public ExternalIdMediaType? Type => null; + + /// + public bool Supports(IHasProviderIds item) => item is Book; + } +} diff --git a/MediaBrowser.Providers/Books/GoogleBooks/GoogleBooksExternalUrlProvider.cs b/MediaBrowser.Providers/Books/GoogleBooks/GoogleBooksExternalUrlProvider.cs new file mode 100644 index 0000000000..0559db2e2b --- /dev/null +++ b/MediaBrowser.Providers/Books/GoogleBooks/GoogleBooksExternalUrlProvider.cs @@ -0,0 +1,25 @@ +using System.Collections.Generic; +using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Providers; +using MediaBrowser.Model.Entities; + +namespace MediaBrowser.Providers.Books.GoogleBooks; + +/// +public class GoogleBooksExternalUrlProvider : IExternalUrlProvider +{ + /// + public string Name => "Google Books"; + + /// + public IEnumerable GetExternalUrls(BaseItem item) + { + if (item.TryGetProviderId("GoogleBooks", out var externalId)) + { + if (item is Book) + { + yield return $"https://books.google.com/books?id={externalId}"; + } + } + } +} diff --git a/MediaBrowser.Providers/MediaBrowser.Providers.csproj b/MediaBrowser.Providers/MediaBrowser.Providers.csproj index 181cda3288..1032582900 100644 --- a/MediaBrowser.Providers/MediaBrowser.Providers.csproj +++ b/MediaBrowser.Providers/MediaBrowser.Providers.csproj @@ -55,18 +55,6 @@ - - - - - - - - - - - - diff --git a/MediaBrowser.Providers/Plugins/ComicVine/ComicVineExternalId.cs b/MediaBrowser.Providers/Plugins/ComicVine/ComicVineExternalId.cs deleted file mode 100644 index 8cbd1f89a7..0000000000 --- a/MediaBrowser.Providers/Plugins/ComicVine/ComicVineExternalId.cs +++ /dev/null @@ -1,23 +0,0 @@ -using MediaBrowser.Controller.Entities; -using MediaBrowser.Controller.Providers; -using MediaBrowser.Model.Entities; -using MediaBrowser.Model.Providers; - -namespace MediaBrowser.Providers.Plugins.ComicVine -{ - /// - public class ComicVineExternalId : IExternalId - { - /// - public string ProviderName => "Comic Vine"; - - /// - public string Key => "ComicVine"; - - /// - public ExternalIdMediaType? Type => null; - - /// - public bool Supports(IHasProviderIds item) => item is Book; - } -} diff --git a/MediaBrowser.Providers/Plugins/ComicVine/ComicVineExternalUrlProvider.cs b/MediaBrowser.Providers/Plugins/ComicVine/ComicVineExternalUrlProvider.cs deleted file mode 100644 index 9122399179..0000000000 --- a/MediaBrowser.Providers/Plugins/ComicVine/ComicVineExternalUrlProvider.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.Collections.Generic; -using MediaBrowser.Controller.Entities; -using MediaBrowser.Controller.Providers; -using MediaBrowser.Model.Entities; - -namespace MediaBrowser.Providers.Plugins.ComicVine; - -/// -public class ComicVineExternalUrlProvider : IExternalUrlProvider -{ - /// - public string Name => "Comic Vine"; - - /// - public IEnumerable GetExternalUrls(BaseItem item) - { - if (item.TryGetProviderId("ComicVine", out var externalId)) - { - switch (item) - { - case Person: - case Book: - yield return $"https://comicvine.gamespot.com/{externalId}"; - break; - } - } - } -} diff --git a/MediaBrowser.Providers/Plugins/ComicVine/ComicVinePersonExternalId.cs b/MediaBrowser.Providers/Plugins/ComicVine/ComicVinePersonExternalId.cs deleted file mode 100644 index 26b8e11380..0000000000 --- a/MediaBrowser.Providers/Plugins/ComicVine/ComicVinePersonExternalId.cs +++ /dev/null @@ -1,23 +0,0 @@ -using MediaBrowser.Controller.Entities; -using MediaBrowser.Controller.Providers; -using MediaBrowser.Model.Entities; -using MediaBrowser.Model.Providers; - -namespace MediaBrowser.Providers.Plugins.ComicVine -{ - /// - public class ComicVinePersonExternalId : IExternalId - { - /// - public string ProviderName => "Comic Vine"; - - /// - public string Key => "ComicVine"; - - /// - public ExternalIdMediaType? Type => ExternalIdMediaType.Person; - - /// - public bool Supports(IHasProviderIds item) => item is Person; - } -} diff --git a/MediaBrowser.Providers/Plugins/ComicVine/Configuration/PluginConfiguration.cs b/MediaBrowser.Providers/Plugins/ComicVine/Configuration/PluginConfiguration.cs deleted file mode 100644 index d35639d7e8..0000000000 --- a/MediaBrowser.Providers/Plugins/ComicVine/Configuration/PluginConfiguration.cs +++ /dev/null @@ -1,10 +0,0 @@ -using MediaBrowser.Model.Plugins; - -namespace MediaBrowser.Providers.Plugins.ComicVine; - -/// -/// Plugin configuration for the Comic Vine provider. -/// -public class PluginConfiguration : BasePluginConfiguration -{ -} diff --git a/MediaBrowser.Providers/Plugins/ComicVine/Plugin.cs b/MediaBrowser.Providers/Plugins/ComicVine/Plugin.cs deleted file mode 100644 index 101fa103b0..0000000000 --- a/MediaBrowser.Providers/Plugins/ComicVine/Plugin.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using MediaBrowser.Common.Configuration; -using MediaBrowser.Common.Plugins; -using MediaBrowser.Controller.Plugins; -using MediaBrowser.Model.Serialization; - -namespace MediaBrowser.Providers.Plugins.ComicVine; - -/// -/// ComicVine plugin instance. -/// -public class Plugin : BasePlugin, IHasEmbeddedImage -{ - /// - /// Initializes a new instance of the class. - /// - /// Instance of the interface. - /// Instance of the interface. - public Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer) - : base(applicationPaths, xmlSerializer) - { - Instance = this; - } - - /// - /// Gets the current plugin instance. - /// - public static Plugin? Instance { get; private set; } - - /// - public override Guid Id => new("3ade6fd1-c76c-4560-b2df-f6bca4c2332f"); - - /// - public override string Name => "Comic Vine"; - - /// - public override string Description => "Get external links for comic books from Comic Vine."; - - /// - // TODO remove when plugin removed from server. - public override string ConfigurationFileName => "Jellyfin.Plugin.ComicVine.xml"; - - /// - public string ImageResourceName => GetType().Namespace + ".jellyfin-plugin-comicvine.svg"; -} diff --git a/MediaBrowser.Providers/Plugins/ComicVine/jellyfin-plugin-comicvine.svg b/MediaBrowser.Providers/Plugins/ComicVine/jellyfin-plugin-comicvine.svg deleted file mode 100644 index 81bde53a51..0000000000 --- a/MediaBrowser.Providers/Plugins/ComicVine/jellyfin-plugin-comicvine.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/MediaBrowser.Providers/Plugins/GoogleBooks/Configuration/PluginConfiguration.cs b/MediaBrowser.Providers/Plugins/GoogleBooks/Configuration/PluginConfiguration.cs deleted file mode 100644 index c32f764810..0000000000 --- a/MediaBrowser.Providers/Plugins/GoogleBooks/Configuration/PluginConfiguration.cs +++ /dev/null @@ -1,10 +0,0 @@ -using MediaBrowser.Model.Plugins; - -namespace MediaBrowser.Providers.Plugins.GoogleBooks; - -/// -/// Plugin configuration for the Google Books provider. -/// -public class PluginConfiguration : BasePluginConfiguration -{ -} diff --git a/MediaBrowser.Providers/Plugins/GoogleBooks/GoogleBooksExternalId.cs b/MediaBrowser.Providers/Plugins/GoogleBooks/GoogleBooksExternalId.cs deleted file mode 100644 index 02d3b36974..0000000000 --- a/MediaBrowser.Providers/Plugins/GoogleBooks/GoogleBooksExternalId.cs +++ /dev/null @@ -1,23 +0,0 @@ -using MediaBrowser.Controller.Entities; -using MediaBrowser.Controller.Providers; -using MediaBrowser.Model.Entities; -using MediaBrowser.Model.Providers; - -namespace MediaBrowser.Providers.Plugins.GoogleBooks -{ - /// - public class GoogleBooksExternalId : IExternalId - { - /// - public string ProviderName => "Google Books"; - - /// - public string Key => "GoogleBooks"; - - /// - public ExternalIdMediaType? Type => null; - - /// - public bool Supports(IHasProviderIds item) => item is Book; - } -} diff --git a/MediaBrowser.Providers/Plugins/GoogleBooks/GoogleBooksExternalUrlProvider.cs b/MediaBrowser.Providers/Plugins/GoogleBooks/GoogleBooksExternalUrlProvider.cs deleted file mode 100644 index 95047ee83e..0000000000 --- a/MediaBrowser.Providers/Plugins/GoogleBooks/GoogleBooksExternalUrlProvider.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.Collections.Generic; -using MediaBrowser.Controller.Entities; -using MediaBrowser.Controller.Providers; -using MediaBrowser.Model.Entities; - -namespace MediaBrowser.Providers.Plugins.GoogleBooks; - -/// -public class GoogleBooksExternalUrlProvider : IExternalUrlProvider -{ - /// - public string Name => "Google Books"; - - /// - public IEnumerable GetExternalUrls(BaseItem item) - { - if (item.TryGetProviderId("GoogleBooks", out var externalId)) - { - if (item is Book) - { - yield return $"https://books.google.com/books?id={externalId}"; - } - } - } -} diff --git a/MediaBrowser.Providers/Plugins/GoogleBooks/Plugin.cs b/MediaBrowser.Providers/Plugins/GoogleBooks/Plugin.cs deleted file mode 100644 index 645e27f5f9..0000000000 --- a/MediaBrowser.Providers/Plugins/GoogleBooks/Plugin.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using MediaBrowser.Common.Configuration; -using MediaBrowser.Common.Plugins; -using MediaBrowser.Controller.Plugins; -using MediaBrowser.Model.Serialization; - -namespace MediaBrowser.Providers.Plugins.GoogleBooks; - -/// -/// Google Books plugin instance. -/// -public class Plugin : BasePlugin, IHasEmbeddedImage -{ - /// - /// Initializes a new instance of the class. - /// - /// Instance of the interface. - /// Instance of the interface. - public Plugin(IApplicationPaths applicationPaths, IXmlSerializer xmlSerializer) - : base(applicationPaths, xmlSerializer) - { - Instance = this; - } - - /// - /// Gets the current plugin instance. - /// - public static Plugin? Instance { get; private set; } - - /// - public override Guid Id => new("9f97232d-e7f4-432d-92d3-c709ce47e30b"); - - /// - public override string Name => "Google Books"; - - /// - public override string Description => "Get external links for books from Google Books."; - - /// - // TODO remove when plugin removed from server. - public override string ConfigurationFileName => "Jellyfin.Plugin.GoogleBooks.xml"; - - /// - public string ImageResourceName => GetType().Namespace + ".jellyfin-plugin-googlebooks.svg"; -} diff --git a/MediaBrowser.Providers/Plugins/GoogleBooks/jellyfin-plugin-googlebooks.svg b/MediaBrowser.Providers/Plugins/GoogleBooks/jellyfin-plugin-googlebooks.svg deleted file mode 100644 index f93ca4a18e..0000000000 --- a/MediaBrowser.Providers/Plugins/GoogleBooks/jellyfin-plugin-googlebooks.svg +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/tests/Jellyfin.Providers.Tests/ExternalId/ComicVineExternalUrlProviderTests.cs b/tests/Jellyfin.Providers.Tests/ExternalId/ComicVineExternalUrlProviderTests.cs index 99604e0933..aaa500b762 100644 --- a/tests/Jellyfin.Providers.Tests/ExternalId/ComicVineExternalUrlProviderTests.cs +++ b/tests/Jellyfin.Providers.Tests/ExternalId/ComicVineExternalUrlProviderTests.cs @@ -1,7 +1,7 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.TV; using MediaBrowser.Model.Entities; -using MediaBrowser.Providers.Plugins.ComicVine; +using MediaBrowser.Providers.Books.ComicVine; using Xunit; namespace Jellyfin.Providers.Tests.ExternalId diff --git a/tests/Jellyfin.Providers.Tests/ExternalId/GoogleBooksExternalUrlProviderTests.cs b/tests/Jellyfin.Providers.Tests/ExternalId/GoogleBooksExternalUrlProviderTests.cs index eec64ac53f..b9ce895dbc 100644 --- a/tests/Jellyfin.Providers.Tests/ExternalId/GoogleBooksExternalUrlProviderTests.cs +++ b/tests/Jellyfin.Providers.Tests/ExternalId/GoogleBooksExternalUrlProviderTests.cs @@ -1,7 +1,7 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.TV; using MediaBrowser.Model.Entities; -using MediaBrowser.Providers.Plugins.GoogleBooks; +using MediaBrowser.Providers.Books.GoogleBooks; using Xunit; namespace Jellyfin.Providers.Tests.ExternalId -- cgit v1.2.3