mirror of
https://github.com/jellyfin/jellyfin-plugin-bookshelf.git
synced 2024-11-23 05:39:51 +00:00
Improve cover image extraction from epub files
This commit is contained in:
parent
3bfc2e6e94
commit
48ebbea268
@ -102,7 +102,7 @@ namespace Jellyfin.Plugin.Bookshelf.Providers.Epub
|
||||
}
|
||||
|
||||
var opfRootDirectory = Path.GetDirectoryName(opfFilePath);
|
||||
if (string.IsNullOrEmpty(opfRootDirectory))
|
||||
if (opfRootDirectory == null)
|
||||
{
|
||||
return new DynamicImageResponse { HasImage = false };
|
||||
}
|
||||
|
@ -55,13 +55,13 @@ namespace Jellyfin.Plugin.Bookshelf.Providers
|
||||
return coverImage;
|
||||
}
|
||||
|
||||
var coverId = ReadEpubCoverInto(opfRootDirectory, "//opf:item[@id='cover']");
|
||||
var coverId = ReadEpubCoverInto(opfRootDirectory, "//opf:item[@id='cover' and @media-type='image/*']");
|
||||
if (coverId is not null)
|
||||
{
|
||||
return coverId;
|
||||
}
|
||||
|
||||
var coverImageId = ReadEpubCoverInto(opfRootDirectory, "//opf:item[@id='cover-image']");
|
||||
var coverImageId = ReadEpubCoverInto(opfRootDirectory, "//opf:item[@id='*cover-image']");
|
||||
if (coverImageId is not null)
|
||||
{
|
||||
return coverImageId;
|
||||
@ -239,7 +239,7 @@ namespace Jellyfin.Plugin.Bookshelf.Providers
|
||||
{
|
||||
try
|
||||
{
|
||||
commitResult(Convert.ToInt32(resultValue, CultureInfo.InvariantCulture));
|
||||
commitResult(Convert.ToInt32(Convert.ToDouble(resultValue, CultureInfo.InvariantCulture)));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user