Commit 013793f9 authored by Ozzieisaacs's avatar Ozzieisaacs

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

parent 2468cf63
...@@ -332,6 +332,9 @@ def get_series(book): ...@@ -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): ...@@ -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),
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment