diff --git a/src/calibre/devices/prs505/sony_cache.py b/src/calibre/devices/prs505/sony_cache.py index 262d1a3f64..f4d1889d64 100644 --- a/src/calibre/devices/prs505/sony_cache.py +++ b/src/calibre/devices/prs505/sony_cache.py @@ -325,9 +325,9 @@ class XMLCache(object): if record is None: record = self.create_text_record(root, i, book.lpath) self.update_text_record(record, book, path, i) - bl_pmap = playlist_map[i] - self.update_playlists(i, root, booklist, bl_pmap, - collections_attributes) + bl_pmap = playlist_map[i] + self.update_playlists(i, root, booklist, bl_pmap, + collections_attributes) self.fix_ids() @@ -339,6 +339,9 @@ class XMLCache(object): collections_attributes): collections = booklist.get_collections(collections_attributes) for category, books in collections.items(): + for b in books: + if self.book_by_lpath(b.lpath, root) is None: + print b.lpath records = [self.book_by_lpath(b.lpath, root) for b in books] # Remove any books that were not found, although this # *should* never happen diff --git a/src/calibre/gui2/ui.py b/src/calibre/gui2/ui.py index 3f67e4184c..8f30e5a9c4 100644 --- a/src/calibre/gui2/ui.py +++ b/src/calibre/gui2/ui.py @@ -636,19 +636,20 @@ class Main(MainWindow, Ui_MainWindow, DeviceGUI): self.download_scheduled_recipe, Qt.QueuedConnection) self.library_view.verticalHeader().sectionClicked.connect(self.view_specific_book) + if self.library_view.model().rowCount(None) > 1: + self.library_view.resizeRowToContents(0) + height = self.library_view.rowHeight(0) + else: + height = None for view in ('library', 'memory', 'card_a', 'card_b'): view = getattr(self, view+'_view') view.verticalHeader().sectionDoubleClicked.connect(self.view_specific_book) + if height is not None: + view.verticalHeader().setDefaultSectionSize(height) self.location_view.setCurrentIndex(self.location_view.model().index(0)) - self._add_filesystem_book = Dispatcher(self.__add_filesystem_book) - v = self.library_view - if v.model().rowCount(None) > 1: - v.resizeRowToContents(0) - height = v.rowHeight(0) - self.library_view.verticalHeader().setDefaultSectionSize(height) self.keyboard_interrupt.connect(self.quit, type=Qt.QueuedConnection) def do_edit_categories(self):