diff --git a/src/calibre/devices/prs505/sony_cache.py b/src/calibre/devices/prs505/sony_cache.py index a0057d8ec9..64f82e2b76 100644 --- a/src/calibre/devices/prs505/sony_cache.py +++ b/src/calibre/devices/prs505/sony_cache.py @@ -288,14 +288,16 @@ class XMLCache(object): if DEBUG: prints('Renaming title', book.title, 'to', title) book.title = title - authors = record.get('author', None) - if authors is not None: - authors = string_to_authors(authors) - if authors != book.authors: - if DEBUG: - prints('Renaming authors', book.authors, 'to', - authors) - book.authors = authors +# We shouldn't do this for Sonys, because the reader strips +# all but the first author. +# authors = record.get('author', None) +# if authors is not None: +# authors = string_to_authors(authors) +# if authors != book.authors: +# if DEBUG: +# prints('Renaming authors', book.authors, 'to', +# authors) +# book.authors = authors for thumbnail in record.xpath( 'descendant::*[local-name()="thumbnail"]'): for img in thumbnail.xpath( diff --git a/src/calibre/gui2/library/models.py b/src/calibre/gui2/library/models.py index cb911d4106..b8fcf235e6 100644 --- a/src/calibre/gui2/library/models.py +++ b/src/calibre/gui2/library/models.py @@ -800,14 +800,14 @@ class DeviceBooksModel(BooksModel): # {{{ self.sort_history = [self.sorted_on] self.unknown = _('Unknown') self.column_map = ['inlibrary', 'title', 'authors', 'timestamp', 'size', - 'tags'] + 'collections'] self.headers = { 'inlibrary' : _('In Library'), 'title' : _('Title'), 'authors' : _('Author(s)'), 'timestamp' : _('Date'), 'size' : _('Size'), - 'tags' : _('Collections') + 'collections': _('Collections') } self.marked_for_deletion = {} self.search_engine = OnDeviceSearch(self) @@ -968,6 +968,23 @@ class DeviceBooksModel(BooksModel): # {{{ dt = dt_factory(item.datetime, assume_utc=True) data[_('Timestamp')] = isoformat(dt, sep=' ', as_utc=False) data[_('Collections')] = ', '.join(item.device_collections) + + tags = getattr(item, 'tags', None) + if tags: + tags = ', '.join(tags) + else: + tags = _('None') + data[_('Tags')] = tags + comments = getattr(item, 'comments', None) + if not comments: + comments = _('None') + data[_('Comments')] = comments + series = getattr(item, 'series', None) + if series: + sidx = getattr(item, 'series_index', 0) + sidx = fmt_sidx(sidx, use_roman = self.use_roman_numbers) + data[_('Series')] = _('Book %s of %s.')%(sidx, series) + self.new_bookdisplay_data.emit(data) def paths(self, rows): @@ -1000,7 +1017,7 @@ class DeviceBooksModel(BooksModel): # {{{ dt = self.db[self.map[row]].datetime dt = dt_factory(dt, assume_utc=True, as_utc=False) return QVariant(strftime(TIME_FMT, dt.timetuple())) - elif cname == 'tags': + elif cname == 'collections': tags = self.db[self.map[row]].device_collections if tags: return QVariant(', '.join(tags)) @@ -1045,7 +1062,7 @@ class DeviceBooksModel(BooksModel): # {{{ self.db[idx].title_sorter = val elif cname == 'authors': self.db[idx].authors = string_to_authors(val) - elif cname == 'tags': + elif cname == 'collections': tags = [i.strip() for i in val.split(',')] tags = [t for t in tags if t] self.db[idx].device_collections = tags diff --git a/src/calibre/gui2/status.py b/src/calibre/gui2/status.py index f7bafacf8b..2759c4074b 100644 --- a/src/calibre/gui2/status.py +++ b/src/calibre/gui2/status.py @@ -101,9 +101,10 @@ class BookInfoDisplay(QWidget): WEIGHTS = collections.defaultdict(lambda : 100) WEIGHTS[_('Path')] = 0 WEIGHTS[_('Formats')] = 1 - WEIGHTS[_('Comments')] = 4 - WEIGHTS[_('Series')] = 2 - WEIGHTS[_('Tags')] = 3 + WEIGHTS[_('Collections')] = 2 + WEIGHTS[_('Series')] = 3 + WEIGHTS[_('Tags')] = 4 + WEIGHTS[_('Comments')] = 5 show_book_info = pyqtSignal()