mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 11:14:02 +02:00
...
This commit is contained in:
commit
769e304195
3 changed files with 32 additions and 12 deletions
|
|
@ -288,14 +288,16 @@ def update_booklist(self, bl, bl_index):
|
|||
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(
|
||||
|
|
|
|||
|
|
@ -983,6 +983,23 @@ def current_changed(self, current, previous):
|
|||
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 = u', '.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 <font face="serif">%s</font> of %s.')%(sidx, series)
|
||||
|
||||
self.new_bookdisplay_data.emit(data)
|
||||
|
||||
def paths(self, rows):
|
||||
|
|
@ -1061,7 +1078,7 @@ def setData(self, index, value, role):
|
|||
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
|
||||
|
|
|
|||
|
|
@ -101,9 +101,10 @@ def mouseReleaseEvent(self, ev):
|
|||
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()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue