diff --git a/src/calibre/gui2/book_details.py b/src/calibre/gui2/book_details.py index 2d7b3b1479..5d396e2e96 100644 --- a/src/calibre/gui2/book_details.py +++ b/src/calibre/gui2/book_details.py @@ -130,15 +130,16 @@ def render_data(mi, use_roman_numbers=True, all_fields=False): if mi.author_link_map[aut]: link = mi.author_link_map[aut] elif gprefs.get('default_author_link'): - vals = {'author': aut} + vals = {'author': aut.replace(' ', '+')} try: - vals['author_sort'] = mi.author_sort_map[aut] + vals['author_sort'] = mi.author_sort_map[aut].replace(' ', '+') except: - vals['author_sort'] = aut + vals['author_sort'] = aut.replace(' ', '+') link = formatter.safe_format( gprefs.get('default_author_link'), vals, '', vals) if link: - authors.append(u'%s'%(urllib2.quote(link), aut)) + link = prepare_string_for_xml(link) + authors.append(u'%s'%(link, aut)) else: authors.append(aut) ans.append((field, u'%s%s'%(name, diff --git a/src/calibre/gui2/tag_browser/ui.py b/src/calibre/gui2/tag_browser/ui.py index 0b01e20154..509f923be1 100644 --- a/src/calibre/gui2/tag_browser/ui.py +++ b/src/calibre/gui2/tag_browser/ui.py @@ -270,12 +270,14 @@ class TagBrowserMixin(object): # {{{ editor = EditAuthorsDialog(parent, db, id, select_sort) d = editor.exec_() if d: - for (id, old_author, new_author, new_sort) in editor.result: + for (id, old_author, new_author, new_sort, new_link) in editor.result: if old_author != new_author: # The id might change if the new author already exists id = db.rename_author(id, new_author) db.set_sort_field_for_author(id, unicode(new_sort), commit=False, notify=False) + db.set_link_field_for_author(id, unicode(new_link), + commit=False, notify=False) db.commit() self.library_view.model().refresh() self.tags_view.recount()