mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #5788 (Floating point numbers truncated to integer value)
This commit is contained in:
commit
48b8cb4d75
@ -47,7 +47,7 @@ class Book(MetaInformation):
|
||||
|
||||
def __eq__(self, other):
|
||||
# use lpath because the prefix can change, changing path
|
||||
return self.path == getattr(other, 'lpath', None)
|
||||
return self.lpath == getattr(other, 'lpath', None)
|
||||
|
||||
@dynamic_property
|
||||
def db_id(self):
|
||||
|
@ -101,6 +101,11 @@ class Float(Int):
|
||||
w.setSpecialValueText(_('Undefined'))
|
||||
w.setSingleStep(1)
|
||||
|
||||
def setter(self, val):
|
||||
if val is None:
|
||||
val = self.widgets[1].minimum()
|
||||
self.widgets[1].setValue(val)
|
||||
|
||||
class Rating(Int):
|
||||
|
||||
def setup_ui(self, parent):
|
||||
|
@ -1304,12 +1304,6 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
|
||||
aid = self.conn.execute('INSERT INTO series(name) VALUES (?)', (series,)).lastrowid
|
||||
self.conn.execute('INSERT INTO books_series_link(book, series) VALUES (?,?)', (id, aid))
|
||||
self.conn.commit()
|
||||
try:
|
||||
row = self.row(id)
|
||||
if row is not None:
|
||||
self.data.set(row, 9, series)
|
||||
except ValueError:
|
||||
pass
|
||||
self.data.set(id, self.FIELD_MAP['series'], series, row_is_id=True)
|
||||
if notify:
|
||||
self.notify('metadata', [id])
|
||||
|
Loading…
x
Reference in New Issue
Block a user