diff --git a/src/calibre/devices/usbms/books.py b/src/calibre/devices/usbms/books.py index d065d0f47a..be154f35c1 100644 --- a/src/calibre/devices/usbms/books.py +++ b/src/calibre/devices/usbms/books.py @@ -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): diff --git a/src/calibre/gui2/custom_column_widgets.py b/src/calibre/gui2/custom_column_widgets.py index de9d839684..90ac7dbbaf 100644 --- a/src/calibre/gui2/custom_column_widgets.py +++ b/src/calibre/gui2/custom_column_widgets.py @@ -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): diff --git a/src/calibre/library/database2.py b/src/calibre/library/database2.py index 7b98dc4537..31e9b43f86 100644 --- a/src/calibre/library/database2.py +++ b/src/calibre/library/database2.py @@ -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])