diff --git a/src/calibre/gui2/dialogs/edit_authors_dialog.py b/src/calibre/gui2/dialogs/edit_authors_dialog.py index 62721f4c33..eae189e04c 100644 --- a/src/calibre/gui2/dialogs/edit_authors_dialog.py +++ b/src/calibre/gui2/dialogs/edit_authors_dialog.py @@ -66,8 +66,8 @@ class EditAuthorsDialog(QDialog, Ui_EditAuthorsDialog): self.sort_by_author_sort.setChecked(True) self.author_sort_order = 1 - # set up author sort calc button self.recalc_author_sort.clicked.connect(self.do_recalc_author_sort) + self.auth_sort_to_author.clicked.connect(self.do_auth_sort_to_author) if select_item is not None: self.table.setCurrentItem(select_item) @@ -108,6 +108,17 @@ class EditAuthorsDialog(QDialog, Ui_EditAuthorsDialog): self.table.setFocus(Qt.OtherFocusReason) self.table.cellChanged.connect(self.cell_changed) + def do_auth_sort_to_author(self): + self.table.cellChanged.disconnect() + for row in range(0,self.table.rowCount()): + item = self.table.item(row, 1) + aus = unicode(item.text()).strip() + c = self.table.item(row, 0) + # Sometimes trailing commas are left by changing between copy algs + c.setText(aus) + self.table.setFocus(Qt.OtherFocusReason) + self.table.cellChanged.connect(self.cell_changed) + def cell_changed(self, row, col): if col == 0: item = self.table.item(row, 0) diff --git a/src/calibre/gui2/dialogs/edit_authors_dialog.ui b/src/calibre/gui2/dialogs/edit_authors_dialog.ui index 6518e6a1b0..3280245959 100644 --- a/src/calibre/gui2/dialogs/edit_authors_dialog.ui +++ b/src/calibre/gui2/dialogs/edit_authors_dialog.ui @@ -52,13 +52,26 @@ - Reset all the author sort values to a value automatically generated from the author. Exactly how this value is automatically generated can be controlled via Preferences->Advanced->Tweaks + Reset all the author sort values to a value automatically +generated from the author. Exactly how this value is automatically +generated can be controlled via Preferences->Advanced->Tweaks Recalculate all author sort values + + + + Copy author sort to author for every author. You typically use this button +after changing Preferences->Advanced->Tweaks->Author sort name algorithm + + + Copy all author sort values to author + + + diff --git a/src/calibre/manual/faq.rst b/src/calibre/manual/faq.rst index 84f99414a8..2942c8dd9e 100644 --- a/src/calibre/manual/faq.rst +++ b/src/calibre/manual/faq.rst @@ -327,10 +327,22 @@ Now coming to author name sorting: * When recalculating the author sort values for books, |app| uses the author sort values for each individual author. Therefore, ensure that the individual author sort values are correct before recalculating the books' author sort values. * You can control whether the Tag Browser display authors using their names or their sort values by setting the :guilabel:`categories_use_field_for_author_name` tweak in Preferences->Tweaks -With all this flexibility, it is possible to have |app| manage your author names however you like. For example, one common request is to have |app| display author names LN, FN. To do this first set the ``author_sort_copy_method`` to ``copy``. Then change all author names to LN, FN via the Manage authors dialog. Then have |app| recalculate author sort values for both authors and books as described above. - Note that you can set an individual author's sort value to whatever you want using :guilabel:`Manage authors`. This is useful when dealing with names that |app| will not get right, such as complex multi-part names like Miguel de Cervantes Saavedra or when dealing with Asian names like Sun Tzu. +With all this flexibility, it is possible to have |app| manage your author names however you like. For example, one common request is to have |app| display author names LN, FN. To do this, and if the note below does not apply to you, then: + * Set the ``author_sort_copy_method`` tweak to ``copy`` as described above. + * Restart calibre. Do not change any book metadata before doing the remaining steps. + * Change all author names to LN, FN using the Manage authors dialog. + * After you have changed all the authors, press the `Recalculate all author sort values` button. + * Press OK, at which point |app| will change the authors in all your books. This can take a while. + +**Note**: when changing from FN LN to LN, FN, it is often the case that the values in author_sort are already in LN, FN format. If this is your case, then do the following: + * set the ``author_sort_copy_method`` tweak to ``copy`` as described above. + * restart calibre. Do not change any book metadata before doing the remaining steps. + * open the Manage authors dialog. Press the ``copy all author sort values to author`` button. + * Check through the authors to be sure you are happy. You can still press Cancel to abandon the changes. Once you press OK, there is no undo. + * Press OK, at which point |app| will change the authors in all your books. This can take a while. + Why doesn't |app| let me store books in my own directory structure? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~