mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Content server and tag browser categories fixes
This commit is contained in:
parent
976acd25a7
commit
a1edb22898
@ -882,7 +882,7 @@ class TagsModel(QAbstractItemModel): # {{{
|
||||
idx = m.index_for_path(path)
|
||||
self.tags_view.setExpanded(idx, True)
|
||||
if idx.internalPointer().type == TagTreeItem.TAG:
|
||||
m.show_item_at_index(idx, boxed=True)
|
||||
m.show_item_at_index(idx, box=True)
|
||||
else:
|
||||
m.show_item_at_index(idx)
|
||||
return True
|
||||
|
@ -424,15 +424,16 @@ class BrowseServer(object):
|
||||
continue
|
||||
cat_len += 1
|
||||
icon = category_icon_map['user:']
|
||||
dot = ucat[cat_len:].find('.')
|
||||
cat = ucat[cat_len:]
|
||||
dot = cat.find('.')
|
||||
if dot > 0:
|
||||
cat = ucat[cat_len:][:dot]
|
||||
cat = cat[:dot]
|
||||
if cat not in uc_displayed:
|
||||
cats.append((cat, ucat[:cat_len+dot], icon))
|
||||
uc_displayed.add(cat)
|
||||
else:
|
||||
cats.append((meta['name'], ucat, icon))
|
||||
uc_displayed.add(ucat)
|
||||
cats.append((cat, ucat, icon))
|
||||
uc_displayed.add(cat)
|
||||
|
||||
cats = u'\n\n'.join(
|
||||
[(u'<li><a title="{2} {0}" href="{3}/browse/category/{1}"> </a>'
|
||||
@ -452,7 +453,7 @@ class BrowseServer(object):
|
||||
items = categories[category]
|
||||
sort = self.browse_sort_categories(items, sort)
|
||||
|
||||
if len(items) == 1:
|
||||
if not cats and len(items) == 1:
|
||||
# Only one item in category, go directly to book list
|
||||
prefix = '' if self.is_wsgi else self.opts.url_prefix
|
||||
html = get_category_items(category, items,
|
||||
|
Loading…
x
Reference in New Issue
Block a user