aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Providers/Books/GoogleBooks/GoogleBooksExternalUrlProvider.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Providers/Books/GoogleBooks/GoogleBooksExternalUrlProvider.cs')
-rw-r--r--MediaBrowser.Providers/Books/GoogleBooks/GoogleBooksExternalUrlProvider.cs25
1 files changed, 25 insertions, 0 deletions
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;
+
+/// <inheritdoc/>
+public class GoogleBooksExternalUrlProvider : IExternalUrlProvider
+{
+ /// <inheritdoc />
+ public string Name => "Google Books";
+
+ /// <inheritdoc />
+ public IEnumerable<string> GetExternalUrls(BaseItem item)
+ {
+ if (item.TryGetProviderId("GoogleBooks", out var externalId))
+ {
+ if (item is Book)
+ {
+ yield return $"https://books.google.com/books?id={externalId}";
+ }
+ }
+ }
+}