mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Prevent db from writing non-numeric series_index values when creating new book entries
This commit is contained in:
parent
095ea7a84c
commit
41ccd7b087
@ -1496,6 +1496,13 @@ class Cache(object):
|
|||||||
if not add_duplicates and self._has_book(mi):
|
if not add_duplicates and self._has_book(mi):
|
||||||
return
|
return
|
||||||
series_index = (self._get_next_series_num_for(mi.series) if mi.series_index is None else mi.series_index)
|
series_index = (self._get_next_series_num_for(mi.series) if mi.series_index is None else mi.series_index)
|
||||||
|
try:
|
||||||
|
series_index = float(series_index)
|
||||||
|
except Exception:
|
||||||
|
try:
|
||||||
|
series_index = float(self._get_next_series_num_for(mi.series))
|
||||||
|
except Exception:
|
||||||
|
series_index = 1.0
|
||||||
if not mi.authors:
|
if not mi.authors:
|
||||||
mi.authors = (_('Unknown'),)
|
mi.authors = (_('Unknown'),)
|
||||||
aus = mi.author_sort if mi.author_sort else self._author_sort_from_authors(mi.authors)
|
aus = mi.author_sort if mi.author_sort else self._author_sort_from_authors(mi.authors)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user