mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
0dafccf479
commit
7fe6a03db3
@ -26,7 +26,7 @@ from PyQt5.Qt import (
|
||||
from PyQt5.QtWebKitWidgets import QWebView
|
||||
|
||||
from calibre.customize.ui import metadata_plugins
|
||||
from calibre.ebooks.metadata import authors_to_string
|
||||
from calibre.ebooks.metadata import authors_to_string, rating_to_stars
|
||||
from calibre.utils.logging import GUILog as Log
|
||||
from calibre.ebooks.metadata.sources.identify import urls_from_identifiers
|
||||
from calibre.ebooks.metadata.book.base import Metadata
|
||||
@ -269,7 +269,7 @@ class ResultsView(QTableView): # {{{
|
||||
parts.append('<div>%s: %s</div>'%series)
|
||||
if not book.is_null('rating'):
|
||||
style = 'style=\'font-family:"%s"\''%f
|
||||
parts.append('<div %s>%s</div>'%(style, '\u2605'*int(book.rating)))
|
||||
parts.append('<div %s>%s</div>'%(style, rating_to_stars(int(book.rating))))
|
||||
parts.append('</center>')
|
||||
if book.identifiers:
|
||||
urls = urls_from_identifiers(book.identifiers)
|
||||
|
@ -1351,7 +1351,7 @@ class TagsModel(QAbstractItemModel): # {{{
|
||||
if self.db.field_metadata[tag.category]['is_csp']:
|
||||
add_colon = True
|
||||
|
||||
if tag.name and tag.name[0] == u'\u2605': # char is a star. Assume rating
|
||||
if tag.name and tag.name[0] in u'★½': # char is a star or a half. Assume rating
|
||||
ans.append('%s%s:%s'%(prefix, category, len(tag.name)))
|
||||
else:
|
||||
name = tag.original_name
|
||||
|
@ -256,7 +256,7 @@ class SearchPanel:
|
||||
return expr
|
||||
|
||||
category = 'tags' if item.category is 'news' else item.category
|
||||
if item.name and item.name[0] is '★':
|
||||
if item.name and item.name[0] in '★½':
|
||||
# Assume ratings
|
||||
expr = '{}:{}'.format(category, item.name.length)
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user