mirror of
https://github.com/jellyfin/jellyfin-plugin-bookshelf.git
synced 2024-11-26 23:20:27 +00:00
Read date and language information from opf
This commit is contained in:
parent
8233ac6c3e
commit
91781be201
@ -109,6 +109,8 @@ namespace Jellyfin.Plugin.Bookshelf.Providers
|
||||
bookResult.AddPerson(person);
|
||||
});
|
||||
|
||||
ReadStringInto("//dc:language", language => bookResult.ResultLanguage = language);
|
||||
|
||||
return bookResult;
|
||||
}
|
||||
|
||||
@ -122,6 +124,20 @@ namespace Jellyfin.Plugin.Bookshelf.Providers
|
||||
ReadStringInto("//dc:identifier[@opf:scheme='ISBN']", isbn => book.SetProviderId("ISBN", isbn));
|
||||
ReadStringInto("//dc:identifier[@opf:scheme='AMAZON']", amazon => book.SetProviderId("Amazon", amazon));
|
||||
|
||||
ReadStringInto("//dc:date", date =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var dateTime = DateTime.Parse(date, DateTimeFormatInfo.InvariantInfo);
|
||||
book.PremiereDate = dateTime.Date;
|
||||
book.ProductionYear = dateTime.Date.Year;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.LogError(e, "Error reading date");
|
||||
}
|
||||
});
|
||||
|
||||
var genresNodes = _document.SelectNodes("//dc:subject", _namespaceManager);
|
||||
|
||||
if (genresNodes != null && genresNodes.Count > 0)
|
||||
|
Loading…
Reference in New Issue
Block a user