I've found that many (all?) of the books that I download from Amazon have the author name listed as lastname, firstname. Consequently, when adding the book to Calibre, I have to edit the author name and sort name.

Would it be possible to write a plugin that would fix the metadata in Calibre when author name is listed as lastname, firstname?

I just tried it with a sample, and it didn't seem to help. Whether that option was ticked or not, author name was shown as "Price, Willard".

The swap option only works if the data is read from the file name. The read metadata from file (next to it) would need to be unchecked.

Quote:

Originally Posted by avantman42

One other point - if the option did work, it'd have to edit books not bought at Amazon, since it's only books bought from Amazon that have this issue.

I am confused what your "One other point" is, we change options to suit what we do in calibre all of time. The swap option does work when adding books reading their file name. I don't know if this can be done when adding books from the Kindle. The Quick Preferences Plugin allows quick on the fly changing of these settings, quite easily.

Update: This thread should help you change a bunch of these last, first names using the search and replace in the bulk metadata edit area.

It is relatively simple to create a plugin to do this, but it would just duplicate functionality that exists using search/replace as per that link that dwanthny pointed you at. In a future version of the Quality Check plugin I may incorporate something like that.

There are already a bewildering away of GUI things related to authors - Search and Replace, the Manage Authors dialog, search queries and a tweak. It is a highly confusing and overly complicated part of Calibre imho. A user should be asked in the wizard when they first start Calibre whether they want to display their authors as FN LN or LN, FN, and have a flip author name menu/button for when they have imported it the wrong way around. Maybe I am just wishfully over-simplifying it.

have a flip author name menu/button for when they have imported it the wrong way around.

I may not have explained myself very well, but that's what I was hoping for. I check/edit the metadata whenever I add a book, so I don't need to do a mass update/fix. Basically, I was being lazy and looking for a simpler/better way than manually copying/pasting to correct the name.

I think you explained yourself fine We just wanted to suggest ways of if possible of avoiding getting the author in the wrong order in the first place.

I would suggest you raise a feature request ticket for the edit metadata and bulk edit metadata dialogs and see what Kovid says about it. Personally while possible I don't believe a plugin menu would be a "convenient" enough general solution, and a plugin approach cannot be used to extend those dialogs.

I may not have explained myself very well, but that's what I was hoping for. I check/edit the metadata whenever I add a book, so I don't need to do a mass update/fix. Basically, I was being lazy and looking for a simpler/better way than manually copying/pasting to correct the name.

I agree with you, having the ability to swap fn ln would be nice. If the First name and Last names were separate fields in the database this feature would already exist, but they exist in one field so accomplishing this feat is best (easiest) done on importing the book prior to placing those names in the database.

True, it would be a useful option to have there. However the Manage Authors dialog is one of the least discoverable dialogs in Calibre and suffers from a lack of find/filtering. Hitting Alt-A on a book to get all occurrences of the author and then E to bulk edit is a more natural route in my workflow.

I was just going to ask this exact same question under the exact same circumstances. The sort order is generally correct, so I've often wished that the button between the author and the author sort could be used to go either way (take the LN, FN in the sort order and generate FN LN in the author field). It wouldn't work for multiple authors, but it would be a help.