From e20624a445f15215caa515de98957e51d663e7be Mon Sep 17 00:00:00 2001 From: John Schember Date: Sat, 14 May 2011 12:10:05 -0400 Subject: [PATCH] Store: Handle | in author names for LN,FN records. --- src/calibre/gui2/actions/store.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/calibre/gui2/actions/store.py b/src/calibre/gui2/actions/store.py index 5007dad659..4e0c8bb2ba 100644 --- a/src/calibre/gui2/actions/store.py +++ b/src/calibre/gui2/actions/store.py @@ -49,14 +49,23 @@ class StoreAction(InterfaceAction): return rows[0].row() def _get_author(self, row): - author = '' + authors = [] + if self.gui.current_view() is self.gui.library_view: - author = self.gui.library_view.model().authors(row) + a = self.gui.library_view.model().authors(row) + authors = a.split(',') else: mi = self.gui.current_view().model().get_book_display_info(row) - author = ' & '.join(mi.authors) + authors = mi.authors - return author + corrected_authors = [] + for x in authors: + a = x.split('|') + a.reverse() + a = ' '.join(a) + corrected_authors.append(a) + + return ' & '.join(corrected_authors) def search_author(self): row = self._get_selected_row()