mirror of
https://github.com/jellyfin/jellyfin-plugin-bookshelf.git
synced 2024-11-26 23:20:27 +00:00
10.9
This commit is contained in:
parent
5baaa87b6e
commit
3bfc2e6e94
@ -4,6 +4,7 @@ using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using Jellyfin.Data.Enums;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
|
||||
@ -102,7 +103,7 @@ namespace Jellyfin.Plugin.Bookshelf.Common
|
||||
// If the book is in a folder, the folder's name will be set as the series name
|
||||
// If it's not in a folder, the series name will be set to the name of the collection
|
||||
// So if we couldn't find the series name in the book name, use the folder name instead
|
||||
if (string.IsNullOrWhiteSpace(result.SeriesName) && seriesName != CollectionType.Books)
|
||||
if (string.IsNullOrWhiteSpace(result.SeriesName) && !string.Equals(seriesName, "books", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
result.SeriesName = seriesName;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<RootNamespace>Jellyfin.Plugin.Bookshelf</RootNamespace>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
@ -12,8 +12,8 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Jellyfin.Controller" Version="10.*-*" />
|
||||
<PackageReference Include="Microsoft.Extensions.Http" Version="6.*-*" />
|
||||
<PackageReference Include="sharpcompress" Version="0.32.2" />
|
||||
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
|
||||
<PackageReference Include="sharpcompress" Version="0.36.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
<!-- Code Analyzers-->
|
||||
<ItemGroup>
|
||||
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
|
||||
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.556" PrivateAssets="All" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -2,7 +2,8 @@ using Jellyfin.Plugin.Bookshelf.Providers;
|
||||
using Jellyfin.Plugin.Bookshelf.Providers.ComicBookInfo;
|
||||
using Jellyfin.Plugin.Bookshelf.Providers.ComicInfo;
|
||||
using Jellyfin.Plugin.Bookshelf.Providers.ComicVine;
|
||||
using MediaBrowser.Common.Plugins;
|
||||
using MediaBrowser.Controller;
|
||||
using MediaBrowser.Controller.Plugins;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
|
||||
namespace Jellyfin.Plugin.Bookshelf
|
||||
@ -13,7 +14,7 @@ namespace Jellyfin.Plugin.Bookshelf
|
||||
public class PluginServiceRegistrator : IPluginServiceRegistrator
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public void RegisterServices(IServiceCollection serviceCollection)
|
||||
public void RegisterServices(IServiceCollection serviceCollection, IServerApplicationHost applicationHost)
|
||||
{
|
||||
// register the proxy local metadata provider for comic files
|
||||
serviceCollection.AddSingleton<ComicFileProvider>();
|
||||
|
@ -108,7 +108,7 @@ namespace Jellyfin.Plugin.Bookshelf.Providers
|
||||
/// </summary>
|
||||
/// <param name="archive">The archive to search.</param>
|
||||
/// <returns>The search result.</returns>
|
||||
private (ZipArchiveEntry coverEntry, ImageFormat imageFormat)? FindCoverEntryInZip(ZipArchive archive)
|
||||
private (ZipArchiveEntry CoverEntry, ImageFormat ImageFormat)? FindCoverEntryInZip(ZipArchive archive)
|
||||
{
|
||||
foreach (ImageFormat imageFormat in Enum.GetValues(typeof(ImageFormat)))
|
||||
{
|
||||
|
@ -5,6 +5,7 @@ using System.Linq;
|
||||
using System.Text.Json;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Jellyfin.Data.Enums;
|
||||
using Jellyfin.Extensions.Json;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
@ -185,7 +186,17 @@ namespace Jellyfin.Plugin.Bookshelf.Providers.ComicBookInfo
|
||||
person.Person = name[1].Trim(' ') + " " + name[0].Trim(' ');
|
||||
}
|
||||
|
||||
var personInfo = new PersonInfo { Name = person.Person, Type = person.Role };
|
||||
if (!Enum.TryParse(person.Role, out PersonKind personKind))
|
||||
{
|
||||
personKind = PersonKind.Unknown;
|
||||
}
|
||||
|
||||
if (string.Equals("Colorer", person.Role, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
personKind = PersonKind.Colorist;
|
||||
}
|
||||
|
||||
var personInfo = new PersonInfo { Name = person.Person, Type = personKind };
|
||||
metadataResult.AddPerson(personInfo);
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,7 @@ using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
using System.Xml.XPath;
|
||||
using Jellyfin.Data.Enums;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
|
||||
@ -70,7 +71,7 @@ namespace Jellyfin.Plugin.Bookshelf.Providers.ComicInfo
|
||||
{
|
||||
foreach (var author in authors)
|
||||
{
|
||||
var person = new PersonInfo { Name = author, Type = "Author" };
|
||||
var person = new PersonInfo { Name = author, Type = PersonKind.Author };
|
||||
metadataResult.AddPerson(person);
|
||||
}
|
||||
});
|
||||
@ -78,7 +79,7 @@ namespace Jellyfin.Plugin.Bookshelf.Providers.ComicInfo
|
||||
{
|
||||
foreach (var penciller in pencilers)
|
||||
{
|
||||
var person = new PersonInfo { Name = penciller, Type = "Penciller" };
|
||||
var person = new PersonInfo { Name = penciller, Type = PersonKind.Penciller };
|
||||
metadataResult.AddPerson(person);
|
||||
}
|
||||
});
|
||||
@ -86,7 +87,7 @@ namespace Jellyfin.Plugin.Bookshelf.Providers.ComicInfo
|
||||
{
|
||||
foreach (var inker in inkers)
|
||||
{
|
||||
var person = new PersonInfo { Name = inker, Type = "Inker" };
|
||||
var person = new PersonInfo { Name = inker, Type = PersonKind.Inker };
|
||||
metadataResult.AddPerson(person);
|
||||
}
|
||||
});
|
||||
@ -94,7 +95,7 @@ namespace Jellyfin.Plugin.Bookshelf.Providers.ComicInfo
|
||||
{
|
||||
foreach (var letterer in letterers)
|
||||
{
|
||||
var person = new PersonInfo { Name = letterer, Type = "Letterer" };
|
||||
var person = new PersonInfo { Name = letterer, Type = PersonKind.Letterer };
|
||||
metadataResult.AddPerson(person);
|
||||
}
|
||||
});
|
||||
@ -102,7 +103,7 @@ namespace Jellyfin.Plugin.Bookshelf.Providers.ComicInfo
|
||||
{
|
||||
foreach (var coverartist in coverartists)
|
||||
{
|
||||
var person = new PersonInfo { Name = coverartist, Type = "Cover Artist" };
|
||||
var person = new PersonInfo { Name = coverartist, Type = PersonKind.CoverArtist };
|
||||
metadataResult.AddPerson(person);
|
||||
}
|
||||
});
|
||||
@ -110,7 +111,7 @@ namespace Jellyfin.Plugin.Bookshelf.Providers.ComicInfo
|
||||
{
|
||||
foreach (var colourist in colourists)
|
||||
{
|
||||
var person = new PersonInfo { Name = colourist, Type = "Colourist" };
|
||||
var person = new PersonInfo { Name = colourist, Type = PersonKind.Colorist };
|
||||
metadataResult.AddPerson(person);
|
||||
}
|
||||
});
|
||||
|
@ -21,7 +21,7 @@ namespace Jellyfin.Plugin.Bookshelf.Providers.ComicInfo
|
||||
|
||||
private readonly IFileSystem _fileSystem;
|
||||
private readonly ILogger<ExternalComicInfoProvider> _logger;
|
||||
private readonly IComicInfoXmlUtilities _utilities = new ComicInfoXmlUtilities();
|
||||
private readonly ComicInfoXmlUtilities _utilities = new ComicInfoXmlUtilities();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="ExternalComicInfoProvider"/> class.
|
||||
|
@ -17,7 +17,7 @@ namespace Jellyfin.Plugin.Bookshelf.Providers.ComicInfo
|
||||
{
|
||||
private readonly IFileSystem _fileSystem;
|
||||
private readonly ILogger<InternalComicInfoProvider> _logger;
|
||||
private readonly IComicInfoXmlUtilities _utilities = new ComicInfoXmlUtilities();
|
||||
private readonly ComicInfoXmlUtilities _utilities = new ComicInfoXmlUtilities();
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="InternalComicInfoProvider"/> class.
|
||||
|
@ -161,7 +161,7 @@ namespace Jellyfin.Plugin.Bookshelf.Providers.ComicVine
|
||||
|
||||
var results = GetFromApiResponse<T>(apiResponse);
|
||||
|
||||
if (results.Count() != 1)
|
||||
if (results.Count != 1)
|
||||
{
|
||||
_logger.LogError("Unexpected number of results in Comic Vine API response.");
|
||||
return default;
|
||||
@ -176,25 +176,25 @@ namespace Jellyfin.Plugin.Bookshelf.Providers.ComicVine
|
||||
/// <typeparam name="T">Type of the results.</typeparam>
|
||||
/// <param name="response">API response.</param>
|
||||
/// <returns>The results.</returns>
|
||||
protected IEnumerable<T> GetFromApiResponse<T>(BaseApiResponse<T> response)
|
||||
protected IReadOnlyList<T> GetFromApiResponse<T>(BaseApiResponse<T> response)
|
||||
{
|
||||
if (response.IsError)
|
||||
{
|
||||
_logger.LogError("Comic Vine API response received with error code {ErrorCode} : {ErrorMessage}", response.StatusCode, response.Error);
|
||||
return Enumerable.Empty<T>();
|
||||
return Array.Empty<T>();
|
||||
}
|
||||
|
||||
if (response is SearchApiResponse<T> searchResponse)
|
||||
{
|
||||
return searchResponse.Results;
|
||||
return searchResponse.Results.ToList();
|
||||
}
|
||||
else if (response is ItemApiResponse<T> itemResponse)
|
||||
{
|
||||
return itemResponse.Results == null ? Enumerable.Empty<T>() : new[] { itemResponse.Results };
|
||||
return itemResponse.Results == null ? Array.Empty<T>() : [itemResponse.Results];
|
||||
}
|
||||
else
|
||||
{
|
||||
return Enumerable.Empty<T>();
|
||||
return Array.Empty<T>();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,7 @@ using System.Net.Http;
|
||||
using System.Net.Http.Json;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Jellyfin.Data.Enums;
|
||||
using Jellyfin.Plugin.Bookshelf.Common;
|
||||
using Jellyfin.Plugin.Bookshelf.Providers.ComicVine.Models;
|
||||
using MediaBrowser.Common.Net;
|
||||
@ -142,7 +143,7 @@ namespace Jellyfin.Plugin.Bookshelf.Providers.ComicVine
|
||||
var personInfo = new PersonInfo
|
||||
{
|
||||
Name = person.Name,
|
||||
Type = person.Roles.Any() ? GetPersonKindFromRole(person.Roles.First()) : "Unknown"
|
||||
Type = person.Roles.Any() ? GetPersonKindFromRole(person.Roles.First()) : PersonKind.Unknown
|
||||
};
|
||||
|
||||
personInfo.SetProviderId(ComicVineConstants.ProviderId, GetProviderIdFromSiteDetailUrl(person.SiteDetailUrl));
|
||||
@ -151,24 +152,24 @@ namespace Jellyfin.Plugin.Bookshelf.Providers.ComicVine
|
||||
}
|
||||
}
|
||||
|
||||
private string GetPersonKindFromRole(PersonCreditRole role)
|
||||
private PersonKind GetPersonKindFromRole(PersonCreditRole role)
|
||||
{
|
||||
return role switch
|
||||
{
|
||||
PersonCreditRole.Artist => "Artist",
|
||||
PersonCreditRole.Colorist => "Colorist",
|
||||
PersonCreditRole.Cover => "CoverArtist",
|
||||
PersonCreditRole.Editor => "Editor",
|
||||
PersonCreditRole.Inker => "Inker",
|
||||
PersonCreditRole.Letterer => "Letterer",
|
||||
PersonCreditRole.Penciler => "Penciller",
|
||||
PersonCreditRole.Translator => "Translator",
|
||||
PersonCreditRole.Writer => "Writer",
|
||||
PersonCreditRole.Artist => PersonKind.Artist,
|
||||
PersonCreditRole.Colorist => PersonKind.Colorist,
|
||||
PersonCreditRole.Cover => PersonKind.CoverArtist,
|
||||
PersonCreditRole.Editor => PersonKind.Editor,
|
||||
PersonCreditRole.Inker => PersonKind.Inker,
|
||||
PersonCreditRole.Letterer => PersonKind.Letterer,
|
||||
PersonCreditRole.Penciler => PersonKind.Penciller,
|
||||
PersonCreditRole.Translator => PersonKind.Translator,
|
||||
PersonCreditRole.Writer => PersonKind.Writer,
|
||||
PersonCreditRole.Assistant
|
||||
or PersonCreditRole.Designer
|
||||
or PersonCreditRole.Journalist
|
||||
or PersonCreditRole.Production
|
||||
or PersonCreditRole.Other => "Unknown",
|
||||
or PersonCreditRole.Other => PersonKind.Unknown,
|
||||
_ => throw new ArgumentException($"Unknown role: {role}"),
|
||||
};
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Jellyfin.Data.Enums;
|
||||
using Jellyfin.Plugin.Bookshelf.Common;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
@ -292,7 +293,7 @@ namespace Jellyfin.Plugin.Bookshelf.Providers.GoogleBooks
|
||||
metadataResult.AddPerson(new PersonInfo
|
||||
{
|
||||
Name = author,
|
||||
Type = "Author",
|
||||
Type = PersonKind.Author,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Xml;
|
||||
using Jellyfin.Data.Enums;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
@ -105,7 +106,7 @@ namespace Jellyfin.Plugin.Bookshelf.Providers
|
||||
var bookResult = new MetadataResult<Book> { Item = book, HasMetadata = true };
|
||||
ReadStringInto("//dc:creator", author =>
|
||||
{
|
||||
var person = new PersonInfo { Name = author, Type = "Author" };
|
||||
var person = new PersonInfo { Name = author, Type = PersonKind.Author };
|
||||
bookResult.AddPerson(person);
|
||||
});
|
||||
|
||||
|
20
build.yaml
20
build.yaml
@ -2,8 +2,8 @@
|
||||
name: "Bookshelf"
|
||||
guid: "9c4e63f1-031b-4f25-988b-4f7d78a8b53e"
|
||||
version: 10
|
||||
targetAbi: "10.8.13.0"
|
||||
framework: "net6.0"
|
||||
targetAbi: "10.9.0.0"
|
||||
framework: "net8.0"
|
||||
owner: "jellyfin"
|
||||
overview: "Manage your books"
|
||||
description: >
|
||||
@ -13,19 +13,3 @@ category: "Metadata"
|
||||
artifacts:
|
||||
- "Jellyfin.Plugin.Bookshelf.dll"
|
||||
changelog: |-
|
||||
- Add Unit tests for ComicInfo and ComicBookInfo formats (#70) @carif
|
||||
|
||||
### New features and improvements ###
|
||||
- Add Comic Vine metadata provider (#81) @Pithaya
|
||||
- Add Google Books external id (#80) @Pithaya
|
||||
- Add unit tests for the Google Books providers (#78) @Pithaya
|
||||
- Improve title handling of epub files (#75) @carif
|
||||
|
||||
### Bug Fixes ###
|
||||
- Update EpubMetadataImageProvider.cs (#66) @wuyu8512
|
||||
|
||||
### Documentation updates ###
|
||||
- Fix typo and improve README formatting (#74) @carif
|
||||
|
||||
### Dependency updates ###
|
||||
- Update xunit-dotnet monorepo to v2.5.3 (#82) @renovate
|
||||
|
@ -114,5 +114,7 @@
|
||||
<Rule Id="CA2101" Action="None" />
|
||||
<!-- disable warning CA2234: Pass System.Uri objects instead of strings -->
|
||||
<Rule Id="CA2234" Action="None" />
|
||||
<!-- Use composite formate -->
|
||||
<Rule Id="CA1863" Action="None"/>
|
||||
</Rules>
|
||||
</RuleSet>
|
||||
|
@ -1,3 +1,4 @@
|
||||
using Jellyfin.Data.Enums;
|
||||
using Jellyfin.Plugin.Bookshelf.Common;
|
||||
using MediaBrowser.Model.Entities;
|
||||
|
||||
@ -15,7 +16,7 @@ namespace Jellyfin.Plugin.Bookshelf.Tests
|
||||
Name = "Children of Time"
|
||||
};
|
||||
|
||||
var result = BookFileNameParser.Parse("Children of Time", CollectionType.Books);
|
||||
var result = BookFileNameParser.Parse("Children of Time", "books");
|
||||
|
||||
Assert.Equal(expected, result);
|
||||
}
|
||||
@ -29,7 +30,7 @@ namespace Jellyfin.Plugin.Bookshelf.Tests
|
||||
Year = 2015
|
||||
};
|
||||
|
||||
var result = BookFileNameParser.Parse("Children of Time (2015)", CollectionType.Books);
|
||||
var result = BookFileNameParser.Parse("Children of Time (2015)", "books");
|
||||
|
||||
Assert.Equal(expected, result);
|
||||
}
|
||||
@ -43,7 +44,7 @@ namespace Jellyfin.Plugin.Bookshelf.Tests
|
||||
Index = 1
|
||||
};
|
||||
|
||||
var result = BookFileNameParser.Parse("1 - Children of Time", CollectionType.Books);
|
||||
var result = BookFileNameParser.Parse("1 - Children of Time", "books");
|
||||
|
||||
Assert.Equal(expected, result);
|
||||
}
|
||||
@ -73,7 +74,7 @@ namespace Jellyfin.Plugin.Bookshelf.Tests
|
||||
Index = 1
|
||||
};
|
||||
|
||||
var result = BookFileNameParser.Parse("1 - Children of Time (2015)", CollectionType.Books);
|
||||
var result = BookFileNameParser.Parse("1 - Children of Time (2015)", "books");
|
||||
|
||||
Assert.Equal(expected, result);
|
||||
}
|
||||
@ -92,7 +93,7 @@ namespace Jellyfin.Plugin.Bookshelf.Tests
|
||||
Index = 2
|
||||
};
|
||||
|
||||
result = BookFileNameParser.Parse("Children of Time (2015) #2 (of 3) (2019)", CollectionType.Books);
|
||||
result = BookFileNameParser.Parse("Children of Time (2015) #2 (of 3) (2019)", "books");
|
||||
Assert.Equal(expected, result);
|
||||
|
||||
// Without series year
|
||||
@ -103,7 +104,7 @@ namespace Jellyfin.Plugin.Bookshelf.Tests
|
||||
Index = 2
|
||||
};
|
||||
|
||||
result = BookFileNameParser.Parse("Children of Time #2 (of 3) (2019)", CollectionType.Books);
|
||||
result = BookFileNameParser.Parse("Children of Time #2 (of 3) (2019)", "books");
|
||||
Assert.Equal(expected, result);
|
||||
|
||||
// Without total count
|
||||
@ -114,7 +115,7 @@ namespace Jellyfin.Plugin.Bookshelf.Tests
|
||||
Index = 2
|
||||
};
|
||||
|
||||
result = BookFileNameParser.Parse("Children of Time #2 (2019)", CollectionType.Books);
|
||||
result = BookFileNameParser.Parse("Children of Time #2 (2019)", "books");
|
||||
Assert.Equal(expected, result);
|
||||
|
||||
// With only issue number
|
||||
@ -124,7 +125,7 @@ namespace Jellyfin.Plugin.Bookshelf.Tests
|
||||
Index = 2
|
||||
};
|
||||
|
||||
result = BookFileNameParser.Parse("Children of Time #2", CollectionType.Books);
|
||||
result = BookFileNameParser.Parse("Children of Time #2", "books");
|
||||
Assert.Equal(expected, result);
|
||||
|
||||
// With only issue number and leading zeroes
|
||||
@ -134,7 +135,7 @@ namespace Jellyfin.Plugin.Bookshelf.Tests
|
||||
Index = 2
|
||||
};
|
||||
|
||||
result = BookFileNameParser.Parse("Children of Time #002", CollectionType.Books);
|
||||
result = BookFileNameParser.Parse("Children of Time #002", "books");
|
||||
Assert.Equal(expected, result);
|
||||
}
|
||||
|
||||
@ -152,7 +153,7 @@ namespace Jellyfin.Plugin.Bookshelf.Tests
|
||||
Index = 2
|
||||
};
|
||||
|
||||
result = BookFileNameParser.Parse("Children of Ruin (Children of Time, #2)", CollectionType.Books);
|
||||
result = BookFileNameParser.Parse("Children of Ruin (Children of Time, #2)", "books");
|
||||
Assert.Equal(expected, result);
|
||||
|
||||
// Goodreads format with year added
|
||||
@ -164,7 +165,7 @@ namespace Jellyfin.Plugin.Bookshelf.Tests
|
||||
Year = 2019
|
||||
};
|
||||
|
||||
result = BookFileNameParser.Parse("Children of Ruin (Children of Time, #2) (2019)", CollectionType.Books);
|
||||
result = BookFileNameParser.Parse("Children of Ruin (Children of Time, #2) (2019)", "books");
|
||||
Assert.Equal(expected, result);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Jellyfin.Data.Enums;
|
||||
using Jellyfin.Plugin.Bookshelf.Providers.ComicBookInfo;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
@ -129,13 +130,13 @@ public class ComicBookInfoProviderTest
|
||||
Assert.NotNull(_comicBookInfoFormat.Metadata);
|
||||
_uut.ReadPeopleMetadata(_comicBookInfoFormat.Metadata!, metadataResult);
|
||||
|
||||
var writer = new PersonInfo { Name = "Alan Moore", Type = "Writer" };
|
||||
var artist = new PersonInfo { Name = "Dave Gibbons", Type = "Artist" };
|
||||
var letterer = new PersonInfo { Name = "Dave Gibbons", Type = "Letterer" };
|
||||
var colorer = new PersonInfo { Name = "John Gibbons", Type = "Colorer" };
|
||||
var editor0 = new PersonInfo { Name = "Len Wein", Type = "Editor" };
|
||||
var editor1 = new PersonInfo { Name = "Barbara Kesel", Type = "Editor" };
|
||||
var example = new PersonInfo { Name = "Takashi Shimoyama", Type = "Example" };
|
||||
var writer = new PersonInfo { Name = "Alan Moore", Type = PersonKind.Writer };
|
||||
var artist = new PersonInfo { Name = "Dave Gibbons", Type = PersonKind.Artist };
|
||||
var letterer = new PersonInfo { Name = "Dave Gibbons", Type = PersonKind.Letterer };
|
||||
var colorer = new PersonInfo { Name = "John Gibbons", Type = PersonKind.Colorist };
|
||||
var editor0 = new PersonInfo { Name = "Len Wein", Type = PersonKind.Editor };
|
||||
var editor1 = new PersonInfo { Name = "Barbara Kesel", Type = PersonKind.Editor };
|
||||
var example = new PersonInfo { Name = "Takashi Shimoyama", Type = PersonKind.Unknown };
|
||||
|
||||
Assert.Collection(
|
||||
metadataResult.People,
|
||||
|
@ -2,6 +2,7 @@ using Xunit;
|
||||
using System;
|
||||
using System.Xml.Linq;
|
||||
using System.Globalization;
|
||||
using Jellyfin.Data.Enums;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
|
||||
@ -117,13 +118,13 @@ public class ComicInfoXmlUtilitiesTest
|
||||
|
||||
_uut.ReadPeopleMetadata(_document, metadataResult);
|
||||
|
||||
var author = new PersonInfo { Name = "Hajime Isayama", Type = "Author" };
|
||||
var penciller = new PersonInfo { Name = "A Penciller", Type = "Penciller" };
|
||||
var inker = new PersonInfo { Name = "An Inker", Type = "Inker" };
|
||||
var letterer = new PersonInfo { Name = "Steve Wands", Type = "Letterer" };
|
||||
var coverArtist0 = new PersonInfo { Name = "Artist A", Type = "Cover Artist" };
|
||||
var coverArtist1 = new PersonInfo { Name = "Takashi Shimoyama", Type = "Cover Artist" };
|
||||
var colourist = new PersonInfo { Name = "An Colourist", Type = "Colourist" };
|
||||
var author = new PersonInfo { Name = "Hajime Isayama", Type = PersonKind.Author };
|
||||
var penciller = new PersonInfo { Name = "A Penciller", Type = PersonKind.Penciller };
|
||||
var inker = new PersonInfo { Name = "An Inker", Type = PersonKind.Inker };
|
||||
var letterer = new PersonInfo { Name = "Steve Wands", Type = PersonKind.Letterer };
|
||||
var coverArtist0 = new PersonInfo { Name = "Artist A", Type = PersonKind.CoverArtist };
|
||||
var coverArtist1 = new PersonInfo { Name = "Takashi Shimoyama", Type = PersonKind.CoverArtist };
|
||||
var colourist = new PersonInfo { Name = "An Colourist", Type = PersonKind.Colorist };
|
||||
|
||||
Assert.Collection(metadataResult.People, authorActual =>
|
||||
{
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System.Net;
|
||||
using Jellyfin.Data.Enums;
|
||||
using Jellyfin.Plugin.Bookshelf.Providers.ComicVine;
|
||||
using Jellyfin.Plugin.Bookshelf.Tests.Http;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
@ -277,31 +278,31 @@ namespace Jellyfin.Plugin.Bookshelf.Tests
|
||||
p =>
|
||||
{
|
||||
Assert.Equal("Ben Applegate", p.Name);
|
||||
Assert.Equal("Editor", p.Type);
|
||||
Assert.Equal(PersonKind.Editor, p.Type);
|
||||
Assert.True(HasComicVineId("ben-applegate/4040-74578", p.ProviderIds));
|
||||
},
|
||||
p =>
|
||||
{
|
||||
Assert.Equal("Hajime Isayama", p.Name);
|
||||
Assert.Equal("Writer", p.Type);
|
||||
Assert.Equal(PersonKind.Writer, p.Type);
|
||||
Assert.True(HasComicVineId("hajime-isayama/4040-64651", p.ProviderIds));
|
||||
},
|
||||
p =>
|
||||
{
|
||||
Assert.Equal("Ko Ransom", p.Name);
|
||||
Assert.Equal("Unknown", p.Type);
|
||||
Assert.Equal(PersonKind.Unknown, p.Type);
|
||||
Assert.True(HasComicVineId("ko-ransom/4040-74576", p.ProviderIds));
|
||||
},
|
||||
p =>
|
||||
{
|
||||
Assert.Equal("Steve Wands", p.Name);
|
||||
Assert.Equal("Letterer", p.Type);
|
||||
Assert.Equal(PersonKind.Letterer, p.Type);
|
||||
Assert.True(HasComicVineId("steve-wands/4040-47630", p.ProviderIds));
|
||||
},
|
||||
p =>
|
||||
{
|
||||
Assert.Equal("Takashi Shimoyama", p.Name);
|
||||
Assert.Equal("CoverArtist", p.Type);
|
||||
Assert.Equal(PersonKind.CoverArtist, p.Type);
|
||||
Assert.True(HasComicVineId("takashi-shimoyama/4040-74571", p.ProviderIds));
|
||||
});
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
using System.Net;
|
||||
using Jellyfin.Data.Enums;
|
||||
using Jellyfin.Plugin.Bookshelf.Providers.GoogleBooks;
|
||||
using Jellyfin.Plugin.Bookshelf.Tests.Http;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
@ -218,7 +219,7 @@ namespace Jellyfin.Plugin.Bookshelf.Tests
|
||||
p =>
|
||||
{
|
||||
Assert.Equal("Adrian Tchaikovsky", p.Name);
|
||||
Assert.Equal("Author", p.Type);
|
||||
Assert.Equal(PersonKind.Author, p.Type);
|
||||
});
|
||||
|
||||
Assert.True(HasGoogleId("49T5twEACAAJ", metadataResult.Item.ProviderIds));
|
||||
@ -278,7 +279,7 @@ namespace Jellyfin.Plugin.Bookshelf.Tests
|
||||
p =>
|
||||
{
|
||||
Assert.Equal("Adrian Tchaikovsky", p.Name);
|
||||
Assert.Equal("Author", p.Type);
|
||||
Assert.Equal(PersonKind.Author, p.Type);
|
||||
});
|
||||
|
||||
Assert.True(HasGoogleId("G7utDwAAQBAJ", metadataResult.Item.ProviderIds));
|
||||
|
@ -1,7 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<IsPackable>false</IsPackable>
|
||||
@ -11,14 +11,14 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Jellyfin.Controller" Version="10.*-*" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
|
||||
<PackageReference Include="NSubstitute" Version="5.1.0" />
|
||||
<PackageReference Include="NSubstitute.Analyzers.CSharp" Version="1.0.16">
|
||||
<PackageReference Include="NSubstitute.Analyzers.CSharp" Version="1.0.17">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="xunit" Version="2.5.3" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.3">
|
||||
<PackageReference Include="xunit" Version="2.7.0" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
|
Loading…
Reference in New Issue
Block a user