Fix for #1391 (Kobo sync not working if series is given, but no series_index)

pull/1405/head
Ozzieisaacs 5 years ago
parent 2468cf63cc
commit 013793f989

@ -332,6 +332,9 @@ def get_series(book):
return None return None
return book.series[0].name return book.series[0].name
def get_seriesindex(book):
return book.series_index or 1
def get_metadata(book): def get_metadata(book):
download_urls = [] download_urls = []
@ -386,8 +389,8 @@ def get_metadata(book):
name = get_series(book) name = get_series(book)
metadata["Series"] = { metadata["Series"] = {
"Name": get_series(book), "Name": get_series(book),
"Number": book.series_index, # ToDo Check int() ? "Number": get_seriesindex(book), # ToDo Check int() ?
"NumberFloat": float(book.series_index), "NumberFloat": float(get_seriesindex(book)),
# Get a deterministic id based on the series name. # Get a deterministic id based on the series name.
"Id": uuid.uuid3(uuid.NAMESPACE_DNS, name), "Id": uuid.uuid3(uuid.NAMESPACE_DNS, name),
} }

Loading…
Cancel
Save