Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 03-21-2010, 11:36 AM   #1
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Help with Merge Records code - E-reader users and developers?

I'm working on merge records code where you will be able to select a first record, which will survive, then more records to be merged into it. The merge records will be deleted after merging is complete.

I've been looking at the code for deleting records, and it refers to 4 different "views" I'm reasonably sure that the views it refers to are the main GUI, a main memory view (probably main memory of the ereader), and two card views (A and B -probably SD cards).

It looks like the code deletes books from the ereader, as well as the main database. I don't have any device that Calibre considers an ereader, so I can't check any of this. The only view I ever see is the main GUI. (At least, that's the only view my traps ever report) I'd like confirmation that these, multiple "views" do appear to those who own ereaders and that Calibre does delete books from the ereader.

I'd particularly like comments on what should happen during the merge process to books on an ereader. Some records will disappear as their books are merged into the main record. I'm inclined to "do nothing" unless the system is looking at the main GUI view, then let the system do whatever it would have done if the changes had been made without an ereader connected. Alternatively, I could "do the same thing" as best I understand it, that happens when these records are just deleted.

Since I've never seen these "views" I'm not even sure if "merge records" is something that one would be able to do when in these views.

Comments would be appreciated.
Starson17 is offline   Reply With Quote
Old 03-21-2010, 11:39 AM   #2
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by Starson17 View Post
Comments would be appreciated.
The more I think about it, the more I think that merger and deletion must occur in the main GUI, which means I'd have to be in view 0, which means I can ignore the other views, and simply merge and delete records from the db. Sound right?
Starson17 is offline   Reply With Quote
Advert
Old 03-21-2010, 12:00 PM   #3
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,801
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
(Mostly) User here By "Main GUI" are we referring to just the main book list display?
Or the Edit Meta-data display?

IMHO the user should be presented this screen for final confirmation (where all is visible).

Do you have a "Flow chart" of the User Actions for the Merge process?
theducks is offline   Reply With Quote
Old 03-21-2010, 12:41 PM   #4
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by theducks View Post
(Mostly) User here By "Main GUI" are we referring to just the main book list display?
Or the Edit Meta-data display?
The main book display. I've got a trap telling me when I enter another "view" defined by Kovid, and it's still in the main book display when I enter the edit metadata screen (which is considered a dialog, not a view).

Quote:
IMHO the user should be presented this screen for final confirmation (where all is visible).
What screen are you referring to? I'm planning a confirmation screen that lists the surviving record and the records that will be deleted.

Quote:
Do you have a "Flow chart" of the User Actions for the Merge process?
In my head .. .but basically, they select the surviving record first (the one all others will be merged into), then the records that they want merged into the surviving record. A check is made that at least two records have been selected, a confirmation screen appears, and upon confirmation, the second and subsequently selected records are merged into the first selected, then those records are removed.

I haven't decided if I'll overwrite the "Same format" if it already exists. I think not, since Kovid didn't like that in my code for adding new books to existing records (although I still sort of like that feature and have kept it for myself). I also haven't decided if i should merge any metadata from deleted records. If the kept record has no cover or comments or rating, but the merged records have that info, I may merge it in. (Comments on this appreciated).

Last edited by Starson17; 03-21-2010 at 12:53 PM.
Starson17 is offline   Reply With Quote
Old 03-21-2010, 12:55 PM   #5
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,801
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Starson17 View Post
The main book display. I've got trap telling me when I enter another "view" defined by Kovid, and it's still in the main book display when I enter the edit metadata screen (which is considered a dialog, not a view).

Quote:
What screen are you referring to? I'm planning a confirmation screen that lists the surviving record and the records that will be deleted.
The Dialog.. Thanks.
Can you have a "Confirmation" Dialog on another Dialog? (was not allowed on the last language (now dead) I used )

Quote:
In my head .. .but basically, they select the surviving record first (the one all others will be merged into), then the records that they want merged into the surviving record. A check is made that all least two records have been selected, a confirmation screen appears, and upon confirmation, the second and subsequently selected records are merged into the first selected, then those records are removed.

I haven't decided if I'll overwrite the "Same format" if it already exists. I think not, since Kovid didn't like that in my code for adding new books to existing records (although I still sort of like that feature and have kept it for myself). I also haven't decided if i should merge any metadata from deleted records. If the kept record has no cover or comments or rating, but the merged records have that info, I may merge it in. (Comments on this appreciated).
The same format issue is my peeve with the current Calibre. What is the Date of the format in the Library? They may not be the same as the original record (add) date. Oh for a "Properties" inspector in the Meta-data browser :sigh: (Treat as black box, Except....)



Thanks for your efforts
theducks is offline   Reply With Quote
Advert
Old 03-21-2010, 01:01 PM   #6
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by Starson17 View Post
I also haven't decided if i should merge any metadata from deleted records. If the kept record has no cover or comments or rating, but the merged records have that info, I may merge it in. (Comments on this appreciated).
I haven't reached this part of the code yet, but how about this:

Concatenate all the comments from all records, (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?
Starson17 is offline   Reply With Quote
Old 03-21-2010, 01:04 PM   #7
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,552
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
As a general comment, in my view I do not think the merge facility should ever affect books already downloaded to an reading device. That makes the concentration on doing it in the main GUI the right way to proceed.
itimpi is offline   Reply With Quote
Old 03-21-2010, 01:06 PM   #8
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,552
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
Quote:
Originally Posted by Starson17 View Post
Concatenate all the comments from all records, (the user can edit it later)
?
With one small proviso - a check for identical comments from more than one record should be made as then these should not be concatenated.
itimpi is offline   Reply With Quote
Old 03-21-2010, 01:29 PM   #9
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by itimpi View Post
With one small proviso - a check for identical comments from more than one record should be made as then these should not be concatenated.
Agreed.
Starson17 is offline   Reply With Quote
Old 03-21-2010, 01:29 PM   #10
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,801
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
I was thinking the whole reason for picking the Destination first was that was the record you wished to preserve. (My original thinking was select the sources, then the destination) Your way made sense, considering you want to keep the Meta-data of that record (otherwise, you would have used a different destination record)
theducks is offline   Reply With Quote
Old 03-21-2010, 01:33 PM   #11
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by itimpi View Post
As a general comment, in my view I do not think the merge facility should ever affect books already downloaded to an reading device. That makes the concentration on doing it in the main GUI the right way to proceed.
What happens if you delete records from the main GUI. Does that impact anything on a reader that's currently connected or connected later?

I just learned moments ago that there are additional "libraries" that appear on the main library line of the GUI corresponding to the ereader device. It may be that the part of the code I've been trying to figure out just decides if one of those libraries has been selected.
Starson17 is offline   Reply With Quote
Old 03-21-2010, 01:37 PM   #12
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by theducks View Post
I was thinking the whole reason for picking the Destination first was that was the record you wished to preserve. (My original thinking was select the sources, then the destination) Your way made sense, considering you want to keep the Meta-data of that record (otherwise, you would have used a different destination record)
Correct - destination is selected first. There's no real reason that the destination couldn't be selected last. I just chose the other way because it was closer to code I'd already written to add new ebooks to existing records.
Starson17 is offline   Reply With Quote
Old 03-21-2010, 01:40 PM   #13
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,801
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Starson17 View Post
What happens if you delete records from the main GUI. Does that impact anything on a reader that's currently connected or connected later?

I just learned moments ago that there are additional "libraries" that appear on the main library line of the GUI corresponding to the ereader device. It may be that the part of the code I've been trying to figure out just decides if one of those libraries has been selected.
Deleting from the Reader Library does not affect the main Calibre library. (I never understood the Transfer from Calibre and delete feature. Delet books, just because you sent to the reader )
theducks is offline   Reply With Quote
Old 03-21-2010, 02:31 PM   #14
polly
Evangelist
polly ought to be getting tired of karma fortunes by now.polly ought to be getting tired of karma fortunes by now.polly ought to be getting tired of karma fortunes by now.polly ought to be getting tired of karma fortunes by now.polly ought to be getting tired of karma fortunes by now.polly ought to be getting tired of karma fortunes by now.polly ought to be getting tired of karma fortunes by now.polly ought to be getting tired of karma fortunes by now.polly ought to be getting tired of karma fortunes by now.polly ought to be getting tired of karma fortunes by now.polly ought to be getting tired of karma fortunes by now.
 
polly's Avatar
 
Posts: 454
Karma: 270240
Join Date: Aug 2009
Device: Sony PRS 650, PocketBook 360, Astak PocketPro (RIP), Tungsten T3
Quote:
Originally Posted by Starson17 View Post
I also haven't decided if i should merge any metadata from deleted records. If the kept record has no cover or comments or rating, but the merged records have that info, I may merge it in. (Comments on this appreciated).
Yes, please.

Usually, I want to merge two records because I have a new one that is better than the one currently in Calibre. Having carefully edited the metadata for the book, I want to keep the cover, tags etc. that exist in that record. The current method of adding a book to an existing record works, but your version sounds much more elegant.
polly is offline   Reply With Quote
Old 03-21-2010, 05:26 PM   #15
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by polly View Post
Usually, I want to merge two records because I have a new one that is better than the one currently in Calibre. Having carefully edited the metadata for the book, I want to keep the cover, tags etc. that exist in that record. The current method of adding a book to an existing record works, but your version sounds much more elegant.
So you've got two records in Calibre? And one has better metadata? What book formats are in these records? Are they different, or sometimes the same? I was just trying to deal with the issue of what to do when the destination record has a book format that is the same as a format in the record to be merged.

Originally I'd contemplated overwriting the destination format with same-formats in the to-be-merged records, then deleting the merged records. I suspect Kovid won't like that design. He didn't like my add books code that overwrote old formats with new. If I don't overwrite when formats overlap, then I also shouldn't delete the old record in a format overlap situation.

Hmmmm. I suppose I can merge only the non-overlap formats, merge the metadata, and warn about the situation. Complexity, complexifies....

If I leave records hanging around due to format overlap, does anyone feel strongly that I need to delete the formats that were merged from the merged records, or can I just leave those records alone after merging all non-overlapping formats into the destination record? The latter is easier (and already works!).
Starson17 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Merge records mruseless Library Management 6 04-16-2014 09:01 AM
Merge book records doesn't copy author and title ? JackLiu Calibre 4 09-25-2010 11:36 PM
Merge feature request (different merge) Tarran Calibre 1 05-24-2010 10:57 AM
Help with Merge Records - an SVG icon Starson17 Calibre 3 03-26-2010 01:20 PM
Developers...large format reader to review your code and annotate changes? brecklundin News 13 09-22-2009 07:25 AM


All times are GMT -4. The time now is 10:34 AM.


MobileRead.com is a privately owned, operated and funded community.