diff --git a/src/calibre/devices/prs500/books.py b/src/calibre/devices/prs500/books.py index db25e7d14c..6c57920487 100644 --- a/src/calibre/devices/prs500/books.py +++ b/src/calibre/devices/prs500/books.py @@ -258,7 +258,7 @@ class BookList(_BookList): if book is not None: self.remove_book(name) node = self.document.createElement(self.prefix + "text") - mime = MIME_MAP[name[name.rfind(".")+1:]] + mime = MIME_MAP[name[name.rfind(".")+1:].lower()] cid = self.max_id()+1 sourceid = str(self[0].sourceid) if len(self) else "1" attrs = { diff --git a/src/calibre/devices/prs505/books.py b/src/calibre/devices/prs505/books.py index a917aa00ae..c97d430d4b 100644 --- a/src/calibre/devices/prs505/books.py +++ b/src/calibre/devices/prs505/books.py @@ -184,7 +184,7 @@ class BookList(_BookList): self.remove_book(name) node = self.document.createElement(self.prefix + "text") - mime = MIME_MAP[name.rpartition('.')[-1]] + mime = MIME_MAP[name.rpartition('.')[-1].lower()] cid = self.max_id()+1 sourceid = str(self[0].sourceid) if len(self) else "1" attrs = { diff --git a/src/calibre/gui2/library.py b/src/calibre/gui2/library.py index 755eef6a1e..ba8101521c 100644 --- a/src/calibre/gui2/library.py +++ b/src/calibre/gui2/library.py @@ -128,7 +128,7 @@ class BooksModel(QAbstractTableModel): for row in rows: if self.cover_cache: id = self.db.id(row) - self.cover_cache.refresh(id) + self.cover_cache.refresh([id]) if row == current_row: self.emit(SIGNAL('new_bookdisplay_data(PyQt_PyObject)'), self.get_book_display_info(row)) diff --git a/src/calibre/library/database2.py b/src/calibre/library/database2.py index 7d287ebfcb..684c308a2d 100644 --- a/src/calibre/library/database2.py +++ b/src/calibre/library/database2.py @@ -139,7 +139,7 @@ class CoverCache(QThread): self.cache_lock.unlock() self.load_queue_lock.lockForWrite() for id in ids: - self.load_queue.append_left(id) + self.load_queue.appendleft(id) self.load_queue_lock.unlock() class Concatenate(object): diff --git a/src/calibre/utils/filenames.py b/src/calibre/utils/filenames.py index de966b14c9..bcd30068e8 100644 --- a/src/calibre/utils/filenames.py +++ b/src/calibre/utils/filenames.py @@ -73,6 +73,10 @@ MAP = { u"ь" : u"'", } #: Translation table +for c in string.whitespace: + MAP[c] = ' ' +PAT = re.compile('['+u''.join(MAP.keys())+']') + def ascii_filename(orig): orig = PAT.sub(lambda m:MAP[m.group()], orig) buf = []