As I use the code on my own data, I've slowly made some changes from how I first planned it:
Quote:
Originally Posted by Starson17
At least with this first version it's going to be a true merge, which means at the end of the merge, there's only going to be one record left - the one you selected first.
|
I've reconsidered this. The Merge option will be available from a right click, like the Remove Books or Edit Metadata. Like those options, there can be multiple variations. I'm thinking of these two:
Merge into 1st selected record, delete other records after merge.
Merge into 1st selected record, keep other records after merge.
If you use the first option, you get as much metadata as will fit into the first record. Any empty fields will be populated from the other records, but duplicate formats, different authors, different titles, different series names, etc. found in the second record will all be deleted when the second and other records are deleted. You end up with only one record, and that record can only contain one author, one title, one publisher, one cover image, etc. Everything in the first record is always safe and never gets overwritten. If there's anything in the second record that you definitely want to keep, you can always delete that item from the first record and it will get moved from the second record into the empty slot in the first during merge.
If you use the second option, the first record is treated,just as above, but the other records are not deleted. It's a sort of "safe" merge, but it does leave you with the extra records. I could delete formats from the second and other records, but I think it's safer to leave them completely untouched. If you accidentally merged the wrong records, all you would have to do is delete out the wrongly added stuff from the first record. If the merge was correct, all you'd have to do is manually delete the extra records.
This would also provide a back door ability to shuffle metadata around. Delete the rating and publisher from the first record and safe merge with a second and the first gets the rating and publisher from the second. Yes, it would also get other metadata in any empty metadata slots, and that would have to be deleted, but it might be useful.
Quote:
I'm planning a confirmation screen that lists the surviving record and the records that will be deleted.
|
I've decided to use the same confirmation dialog used for record deletion. The records you are about to delete/merge are highlighted in front of you. There's no reason to list them again in a dialog, unless you've forgotten which one you chose first, in which case, just cancel and choose again.
Quote:
Concatenate all the comments from all records, <unless they are identical> (the user can edit it later)
Bring in the first valid cover image if the surviving record has none,
Concatenate tags, but remove duplicates,
Ignore publisher and ISBN,
Ratings?
|
I'm not sure about publisher and ISBN. At this point, I'm inclined to bring publisher in, but not ISBN, mainly because ISBN limits the results when fetching metadata. Ratings are currently being brought in from the other records if that field is empty in the first record.
What about author/title? I think author is filled with "Unknown" if it's blank. That is a valid author, but should it be overwritten if a merge record has some other author name? (If I overwrite the author in this one case, then I'd also overwrite the author_sort field) I'm not sure about title. Can that field be blank? (I'm not at home to test this stuff)
The date and pubdate fields never seem to be empty, so I'm ignoring them.
Any comments?