Quote:
Originally Posted by guyanonymous
RE: merge -> that's how I considered it.
Perhaps whichever title you right click upon is the one they get merged into?
|
Whenever possible, I try to reuse working code Kovid has already written. When editing metadata, If you select multiple individual books, then choose the edit metadata individually option, it opens them in the order you selected them.
That means there is already code in there that will handle the books in a defined order, based on selection order. All I would have to do is add a "Merge" option, then process them in a way that's similar to what I've already written (put all books in the first record), then delete all but the first book.
The main problem I have with this is the potential for inadvertent loss of books. I wouldn't want someone to select the entire database, select merge and find they've got only one book left! I was thinking there should be a limit to the number of books being merged (no more than 15?) or a warning when a limit is exceeded.
There should at least be a list of books about to be merged, with a confirmation dialog. (Another bit of code Kovid already has written that I can steal - see the Duplicates list in the Add book dialog.)
I've got lots of books with similar author names, that need merging. That means people would want merger of non-identical author named books. The same applies to title differences. To be useful, it needs to merge very different author/title, so I don't see much protection that can be applied by checking the author/title.
Last, I was trying to decide what would be done with multiple formats. If 3 .pdf files are being merged into a record that already has a .pdf, which one do you keep? The code described above deals with this issue, too. The last one processed is the one that is kept, so I assume the same would make sense.
Feel free to comment.