Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 08-31-2014, 03:45 AM   #1
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,233
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Problem merging metadata

Hi,

I've been looking for this issue, but i have found nothing about it.

I have a problem when I'm merging two records when there're some difference in the metadata info. If I merge two fields which are date or number, if the destination field has a value, it keeps untouched. If I merge two fields which are defined as text with restricted values, however, if the destination field has a value, and the origin field is empty, the value in the destination filed is removed.

I don't know if it's normal, I'm doing something wrong. Any help will be welcome. BTW, it's not related to calibre 2.X, it worked in the same way before.

I have Win7 and I am running calibre 32bits (calibre 64 works the same too, I've tested it).

Thanks in advance.
Terisa de morgan is online now   Reply With Quote
Old 08-31-2014, 06:45 AM   #2
Adoby
Handy Elephant
Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.Adoby ought to be getting tired of karma fortunes by now.
 
Adoby's Avatar
 
Posts: 1,736
Karma: 26785668
Join Date: Dec 2009
Location: Southern Sweden, far out in the quiet woods
Device: Thinkpad E595, Ubuntu Mate, Huawei Mediapad 5, Bouye Likebook Plus
Could be that for fields with restricted values there is no empty value. So the new value always overwrite the old, the logic that empty values don't overwrite existing doesn't apply. And I don't know how that should be changed to ensure that the "right" metadata is used. The only way around would be to be careful about using restricted values...
Adoby is offline   Reply With Quote
Old 08-31-2014, 07:33 AM   #3
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Terisa de morgan View Post
Hi,

I've been looking for this issue, but i have found nothing about it.

I have a problem when I'm merging two records when there're some difference in the metadata info. If I merge two fields which are date or number, if the destination field has a value, it keeps untouched. If I merge two fields which are defined as text with restricted values, however, if the destination field has a value, and the origin field is empty, the value in the destination filed is removed.

I don't know if it's normal, I'm doing something wrong. Any help will be welcome. BTW, it's not related to calibre 2.X, it worked in the same way before.

I have Win7 and I am running calibre 32bits (calibre 64 works the same too, I've tested it).

Thanks in advance.
The problem comes from how selections work.

If you select using the shift key (click on a book, press shift, click on another book), the selection is ordered from top to bottom no matter which book you clicked on first. Thus even if you clicked on the second in the list then the first, the second is being merged into the first as if you had clicked on the first then the second.

If you select using the control key then Qt remembers the order. Click on the second in the list then ctrl-click on the first, after which the first will be merged into the second.

I tested this as follows:
  1. Create an empty book. Give it a title "Book 1" and an author "Author 1"
  2. Create another empty book. Give it a title "Book 2" and an author "Author 2"
  3. Sort the display by title. Book 1 will be above book 2.

Experiment 1
  1. Edit metadata for Book 1. Assign a value to an Enumerated (fixed set of values) column.
  2. Click on Book 1.
  3. Shift-click on Book 2.
  4. Alt-M to merge without deletion.
The enum value in book 1 is gone, replaced by the empty value in book 2. This is as it should be, because the target book is Book 1.

Experiment 2
  1. Edit metadata for Book 1. Assign a value to an Enumerated (fixed set of values) column.
  2. Click on Book 2.
  3. Shift-click on Book 1.
  4. Alt-M to merge without deletion.
Again, the enum value in book 1 is gone. This is because even though you clicked on book 2 first, Qt reports that the first book in the selection is book 1, so calibre merges Book 2 into Book 1 just as in experiment 1.

Experiment 3
  1. Edit metadata for Book 1. Assign a value to an Enumerated (fixed set of values) column.
  2. Click on Book 2.
  3. Ctrl-click on Book 2.
  4. Alt-M to merge without deletion.
This time the enum value from book 1 is copied into book 2 because Qt reports that the first selection is Book 2, making that book the target.

Bottom line: if you use shift-click to select, the target book must be the first one (highest one) in the selection list. This is true no matter what order you used to select the books.
chaley is offline   Reply With Quote
Old 08-31-2014, 01:14 PM   #4
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,800
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
chaley
That explains what I have been seeing for quite a while

Can Kovid include a Warning box (with a don't show again box) to remind folk to sort the target to the top, When the 'M' feature is used?
theducks is offline   Reply With Quote
Old 08-31-2014, 01:16 PM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
There is such a warning already, it even shows you the title of the book that will be the target book.
kovidgoyal is offline   Reply With Quote
Old 08-31-2014, 01:23 PM   #6
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,800
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 kovidgoyal View Post
There is such a warning already, it even shows you the title of the book that will be the target book.
I must have done away with it so long ago
or my 'I have seen that before filter' let it slip by
theducks is offline   Reply With Quote
Old 08-31-2014, 01:57 PM   #7
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,233
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Chaley, I understand what you say, I'm quite aware of this way of working. What I get of your message is that it's right to empty the destination field, although it doesn't work the same for integer or date fields (I always order the book so the destination book is the first in that order).

Perhaps @adoby is right, and that is the problem. I don't know.
Terisa de morgan is online now   Reply With Quote
Old 08-31-2014, 02:22 PM   #8
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Terisa de morgan View Post
Chaley, I understand what you say, I'm quite aware of this way of working. What I get of your message is that it's right to empty the destination field, although it doesn't work the same for integer or date fields (I always order the book so the destination book is the first in that order).

Perhaps @adoby is right, and that is the problem. I don't know.
No, he isn't. Enumerated types have a null (undefined) value.

I just looked more carefully at the merge code. This is a bug. The "if statement" that handles enumerations is not parenthesized correctly, resulting in the source *always* replacing the destination even if the src is empty. I will submit a fix.
chaley is offline   Reply With Quote
Old 08-31-2014, 02:33 PM   #9
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,233
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Thank you very much, chaley. As this is something I do for all my read books, it was a bit PIA.
Terisa de morgan is online now   Reply With Quote
Old 08-31-2014, 07:29 PM   #10
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,568
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
FWIW - I Mark the books I want merge and then Show marked books, it makes it easier to wrangle the target book to the top of the list.

BR
BetterRed is offline   Reply With Quote
Old 09-01-2014, 05:09 AM   #11
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Terisa de morgan View Post
Thank you very much, chaley. As this is something I do for all my read books, it was a bit PIA.
The fix is in place, available now if you run from source otherwise in the next calibre release.
chaley is offline   Reply With Quote
Old 09-01-2014, 06:18 AM   #12
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,233
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by chaley View Post
The fix is in place, available now if you run from source otherwise in the next calibre release.
Thank you very much. It will be in the next calibre release, I compile a lot at work, so I'm a bit lazy at home
Terisa de morgan is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Wrong metadata after merging dancal Library Management 14 12-16-2012 12:36 PM
Merging metadata when adding duplicate magphil Calibre 2 01-14-2012 04:23 AM
Merging duplicate entries with different formats and slightly different metadata? maxsys Library Management 2 02-20-2011 04:19 AM
Jobs Queue, Merging, Metadata, I think that's it.... rabidrobot Calibre 2 08-17-2010 07:31 PM
For Charles/Chaley Merging user defined metadata Starson17 Calibre 20 07-22-2010 10:27 AM


All times are GMT -4. The time now is 07:08 AM.


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