mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Change slash in folder to dots to avoid content server and template problems
This commit is contained in:
parent
40af13276e
commit
1543ff5ea6
@ -605,8 +605,8 @@ class TagsModel(QAbstractItemModel): # {{{
|
||||
else:
|
||||
tt = _(u'The lookup/search name is "{0}"').format(r)
|
||||
|
||||
if r.startswith('@') and r.find('/') >= 0:
|
||||
path_parts = [p.strip() for p in r.split('/') if p.strip()]
|
||||
if r.startswith('@') and r.find('.') >= 0:
|
||||
path_parts = [p.strip() for p in r.split('.') if p.strip()]
|
||||
path = ''
|
||||
for i,p in enumerate(path_parts):
|
||||
path += p
|
||||
@ -621,7 +621,7 @@ class TagsModel(QAbstractItemModel): # {{{
|
||||
self.category_nodes.append(node)
|
||||
else:
|
||||
last_category_node = category_node_map[path]
|
||||
path += '/'
|
||||
path += '.'
|
||||
else:
|
||||
node = TagTreeItem(parent=self.root_item,
|
||||
data=self.categories[i],
|
||||
@ -784,10 +784,10 @@ class TagsModel(QAbstractItemModel): # {{{
|
||||
while True:
|
||||
try:
|
||||
tb_cats.add_user_category(label=cat_name, name=user_cat)
|
||||
slash = cat_name.rfind('/')
|
||||
if slash < 0:
|
||||
dot = cat_name.rfind('.')
|
||||
if dot < 0:
|
||||
break
|
||||
cat_name = cat_name[:slash]
|
||||
cat_name = cat_name[:dot]
|
||||
except ValueError:
|
||||
break
|
||||
|
||||
|
@ -168,7 +168,7 @@ def get_category_items(category, items, restriction, datatype, prefix): # {{{
|
||||
q = i.category
|
||||
if not q:
|
||||
q = category
|
||||
href = '/browse/matches/%s/%s'%(quote(q.replace('/', '/')), quote(id_))
|
||||
href = '/browse/matches/%s/%s'%(quote(q), quote(id_))
|
||||
return templ.format(xml(name), rating,
|
||||
xml(desc), xml(href, True), rstring, prefix)
|
||||
|
||||
@ -367,7 +367,7 @@ class BrowseServer(object):
|
||||
u'<img src="{3}{src}" alt="{0}" />'
|
||||
u'<span class="label">{0}</span>'
|
||||
u'</li>')
|
||||
.format(xml(x, True), xml(quote(y.replace('/', '/'))), xml(_('Browse books by')),
|
||||
.format(xml(x, True), xml(quote(y)), xml(_('Browse books by')),
|
||||
self.opts.url_prefix, src='/browse/icon/'+z)
|
||||
for x, y, z in cats]
|
||||
|
||||
@ -387,7 +387,6 @@ class BrowseServer(object):
|
||||
return sort
|
||||
|
||||
def browse_category(self, category, sort):
|
||||
category = category.replace('/', '/')
|
||||
categories = self.categories_cache()
|
||||
if category not in categories:
|
||||
raise cherrypy.HTTPError(404, 'category not found')
|
||||
|
Loading…
x
Reference in New Issue
Block a user