mirror of
https://github.com/janeczku/calibre-web
synced 2024-11-25 02:57:22 +00:00
Considers the language of the ebook instead of always specifying "English".
This commit is contained in:
parent
b5d5660d04
commit
8a5112502d
@ -443,6 +443,12 @@ def get_seriesindex(book):
|
|||||||
return book.series_index or 1
|
return book.series_index or 1
|
||||||
|
|
||||||
|
|
||||||
|
def get_language(book):
|
||||||
|
if not book.languages:
|
||||||
|
return 'en'
|
||||||
|
return book.languages[0].lang_code
|
||||||
|
|
||||||
|
|
||||||
def get_metadata(book):
|
def get_metadata(book):
|
||||||
download_urls = []
|
download_urls = []
|
||||||
kepub = [data for data in book.data if data.format == 'KEPUB']
|
kepub = [data for data in book.data if data.format == 'KEPUB']
|
||||||
@ -480,7 +486,7 @@ def get_metadata(book):
|
|||||||
"IsInternetArchive": False,
|
"IsInternetArchive": False,
|
||||||
"IsPreOrder": False,
|
"IsPreOrder": False,
|
||||||
"IsSocialEnabled": True,
|
"IsSocialEnabled": True,
|
||||||
"Language": "en",
|
"Language": get_language(book),
|
||||||
"PhoneticPronunciations": {},
|
"PhoneticPronunciations": {},
|
||||||
"PublicationDate": convert_to_kobo_timestamp_string(book.pubdate),
|
"PublicationDate": convert_to_kobo_timestamp_string(book.pubdate),
|
||||||
"Publisher": {"Imprint": "", "Name": get_publisher(book), },
|
"Publisher": {"Imprint": "", "Name": get_publisher(book), },
|
||||||
|
Loading…
Reference in New Issue
Block a user