File tree Expand file tree Collapse file tree 10 files changed +90
-18
lines changed
Jellyfin.Plugin.Bookshelf
tests/Jellyfin.Plugin.Bookshelf.Tests Expand file tree Collapse file tree 10 files changed +90
-18
lines changed Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk" >
22
33 <PropertyGroup >
4- <TargetFramework >net8 .0</TargetFramework >
4+ <TargetFramework >net9 .0</TargetFramework >
55 <RootNamespace >Jellyfin.Plugin.Bookshelf</RootNamespace >
66 <TreatWarningsAsErrors >true</TreatWarningsAsErrors >
77 <GenerateDocumentationFile >true</GenerateDocumentationFile >
1212
1313 <ItemGroup >
1414 <PackageReference Include =" Jellyfin.Controller" Version =" 10.*-*" />
15- <PackageReference Include =" Microsoft.Extensions.Http" Version =" 8 .0.1 " />
15+ <PackageReference Include =" Microsoft.Extensions.Http" Version =" 9 .0.0 " />
1616 <PackageReference Include =" SharpCompress" Version =" 0.38.0" />
1717 </ItemGroup >
1818
Original file line number Diff line number Diff line change @@ -17,9 +17,6 @@ public class ComicVineExternalId : IExternalId
1717 /// <inheritdoc />
1818 public ExternalIdMediaType ? Type => null ; // TODO: No ExternalIdMediaType value for book
1919
20- /// <inheritdoc />
21- public string ? UrlFormatString => ComicVineApiUrls . BaseWebsiteUrl + "/{0}" ;
22-
2320 /// <inheritdoc />
2421 public bool Supports ( IHasProviderIds item ) => item is Book ;
2522 }
Original file line number Diff line number Diff line change 1+ using System . Collections . Generic ;
2+ using MediaBrowser . Controller . Entities ;
3+ using MediaBrowser . Controller . Providers ;
4+ using MediaBrowser . Model . Entities ;
5+
6+ namespace Jellyfin . Plugin . Bookshelf . Providers . ComicVine ;
7+
8+ /// <summary>
9+ /// Url provider for ComicVine.
10+ /// </summary>
11+ public class ComicVineExternalUrlProvider : IExternalUrlProvider
12+ {
13+ /// <inheritdoc/>
14+ public string Name => ComicVineConstants . ProviderName ;
15+
16+ /// <inheritdoc />
17+ public IEnumerable < string > GetExternalUrls ( BaseItem item )
18+ {
19+ if ( item . TryGetProviderId ( ComicVineConstants . ProviderId , out var externalId ) )
20+ {
21+ switch ( item )
22+ {
23+ case Person :
24+ case Book :
25+ yield return $ "{ ComicVineApiUrls . BaseWebsiteUrl } /{ externalId } ";
26+ break ;
27+ }
28+ }
29+ }
30+ }
Original file line number Diff line number Diff line change @@ -17,9 +17,6 @@ public class ComicVinePersonExternalId : IExternalId
1717 /// <inheritdoc />
1818 public ExternalIdMediaType ? Type => ExternalIdMediaType . Person ;
1919
20- /// <inheritdoc />
21- public string ? UrlFormatString => ComicVineApiUrls . BaseWebsiteUrl + "/{0}" ;
22-
2320 /// <inheritdoc />
2421 public bool Supports ( IHasProviderIds item ) => item is Person ;
2522 }
Original file line number Diff line number Diff line change @@ -17,9 +17,6 @@ public class GoogleBooksExternalId : IExternalId
1717 /// <inheritdoc />
1818 public ExternalIdMediaType ? Type => null ; // TODO: No ExternalIdMediaType value for book
1919
20- /// <inheritdoc />
21- public string ? UrlFormatString => "https://books.google.com/books?id={0}" ;
22-
2320 /// <inheritdoc />
2421 public bool Supports ( IHasProviderIds item ) => item is Book ;
2522 }
Original file line number Diff line number Diff line change 1+ using System . Collections . Generic ;
2+ using MediaBrowser . Controller . Entities ;
3+ using MediaBrowser . Controller . Providers ;
4+ using MediaBrowser . Model . Entities ;
5+
6+ namespace Jellyfin . Plugin . Bookshelf . Providers . GoogleBooks ;
7+
8+ /// <summary>
9+ /// External url provider for Google books.
10+ /// </summary>
11+ public class GoogleBooksExternalUrlProvider : IExternalUrlProvider
12+ {
13+ /// <inheritdoc />
14+ public string Name => GoogleBooksConstants . ProviderName ;
15+
16+ /// <inheritdoc />
17+ public IEnumerable < string > GetExternalUrls ( BaseItem item )
18+ {
19+ if ( item . TryGetProviderId ( GoogleBooksConstants . ProviderId , out var externalId ) )
20+ {
21+ if ( item is Book )
22+ {
23+ yield return $ "https://books.google.com/books?id={ externalId } ";
24+ }
25+ }
26+ }
27+ }
Original file line number Diff line number Diff line change @@ -17,9 +17,6 @@ public class ISBNExternalId : IExternalId
1717 /// <inheritdoc />
1818 public ExternalIdMediaType ? Type => null ;
1919
20- /// <inheritdoc />
21- public string ? UrlFormatString => "https://search.worldcat.org/search?q=bn:{0}" ;
22-
2320 /// <inheritdoc />
2421 public bool Supports ( IHasProviderIds item ) => item is Book ;
2522 }
Original file line number Diff line number Diff line change 1+ using System . Collections . Generic ;
2+ using MediaBrowser . Controller . Entities ;
3+ using MediaBrowser . Controller . Providers ;
4+ using MediaBrowser . Model . Entities ;
5+
6+ namespace Jellyfin . Plugin . Bookshelf . Providers ;
7+
8+ /// <summary>
9+ /// External url provider for ISBN.
10+ /// </summary>
11+ public class ISBNExternalUrlProvider : IExternalUrlProvider
12+ {
13+ /// <inheritdoc/>
14+ public string Name => "ISBN" ;
15+
16+ /// <inheritdoc />
17+ public IEnumerable < string > GetExternalUrls ( BaseItem item )
18+ {
19+ if ( item . TryGetProviderId ( "ISBN" , out var externalId ) )
20+ {
21+ if ( item is Book )
22+ {
23+ yield return $ "https://search.worldcat.org/search?q=bn:{ externalId } ";
24+ }
25+ }
26+ }
27+ }
Original file line number Diff line number Diff line change 22name : " Bookshelf"
33guid : " 9c4e63f1-031b-4f25-988b-4f7d78a8b53e"
44version : 12
5- targetAbi : " 10.10 .0.0"
6- framework : " net8 .0"
5+ targetAbi : " 10.11 .0.0"
6+ framework : " net9 .0"
77owner : " jellyfin"
88overview : " Manage your books"
99description : >
1010 Supports several different metadata providers and options for organizing your collection.
1111
12- category : " Metadata "
12+ category : " Books "
1313artifacts :
1414 - " Jellyfin.Plugin.Bookshelf.dll"
1515 - " SharpCompress.dll"
Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk" >
22
33 <PropertyGroup >
4- <TargetFramework >net8 .0</TargetFramework >
4+ <TargetFramework >net9 .0</TargetFramework >
55 <ImplicitUsings >enable</ImplicitUsings >
66 <Nullable >enable</Nullable >
77 <IsPackable >false</IsPackable >
You can’t perform that action at this time.
0 commit comments