Skip to content

Commit 4776bac

Browse files
authored
Jellyfin 10.11 (#130)
1 parent dcec5ec commit 4776bac

File tree

10 files changed

+90
-18
lines changed

10 files changed

+90
-18
lines changed

Jellyfin.Plugin.Bookshelf/Jellyfin.Plugin.Bookshelf.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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>
@@ -12,7 +12,7 @@
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

Jellyfin.Plugin.Bookshelf/Providers/ComicVine/Books/ComicVineExternalId.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff 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
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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+
}

Jellyfin.Plugin.Bookshelf/Providers/ComicVine/Persons/ComicVinePersonExternalId.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff 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
}

Jellyfin.Plugin.Bookshelf/Providers/GoogleBooks/GoogleBooksExternalId.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff 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
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
}

Jellyfin.Plugin.Bookshelf/Providers/ISBNExternalId.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff 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
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
}

build.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
name: "Bookshelf"
33
guid: "9c4e63f1-031b-4f25-988b-4f7d78a8b53e"
44
version: 12
5-
targetAbi: "10.10.0.0"
6-
framework: "net8.0"
5+
targetAbi: "10.11.0.0"
6+
framework: "net9.0"
77
owner: "jellyfin"
88
overview: "Manage your books"
99
description: >
1010
Supports several different metadata providers and options for organizing your collection.
1111
12-
category: "Metadata"
12+
category: "Books"
1313
artifacts:
1414
- "Jellyfin.Plugin.Bookshelf.dll"
1515
- "SharpCompress.dll"

tests/Jellyfin.Plugin.Bookshelf.Tests/Jellyfin.Plugin.Bookshelf.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
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>

0 commit comments

Comments
 (0)