Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 10-20-2010, 04:38 AM   #1
Sweetpea
Grand Sorcerer
Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.
 
Sweetpea's Avatar
 
Posts: 8,069
Karma: 22730000
Join Date: Dec 2008
Location: Krewerd
Device: AVTN8; BBMini; Onyx Boox T68; SGN8
Restore DB

Yikes...

That's what you get when messing around with your external HD: I permanently deleted my .db file...

No worries, or so I thought, there is this nice feature: calibredb restore_database



Which doesn't work...

Restoring database failed with error:
Traceback (most recent call last):
File "site-packages\calibre\library\restore.py", line 93, in run
File "site-packages\calibre\library\restore.py", line 173, in create_cc_metadata
TypeError: unhashable type: 'list'
Sweetpea is offline   Reply With Quote
Old 10-20-2010, 07:02 AM   #2
chaley
"chaley", not "charley"
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: 5,893
Karma: 1216548
Join Date: Jan 2010
Location: France
Device: Many android devices
Well, you do have a talent for pushing corner cases.

The problem is that the OPFs in your hierarchy have conflicting definitions for some custom columns. The code that detects that situation is broken. It is hard to test it, unfortunately.

Attached is a new version of the restore code. I hope it fixes the problem. Unzip it and put the resulting file restore.py into your calibre installation directory in the folder src/calibre/library.

Please a) let me know if it fixes the problem, and b) remember to remove it the next time you upgrade.
Attached Files
File Type: zip restore.zip (2.5 KB, 68 views)
chaley is offline   Reply With Quote
Old 10-20-2010, 07:58 AM   #3
Sweetpea
Grand Sorcerer
Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.
 
Sweetpea's Avatar
 
Posts: 8,069
Karma: 22730000
Join Date: Dec 2008
Location: Krewerd
Device: AVTN8; BBMini; Onyx Boox T68; SGN8
Yep, it works.


and they taught me to test all border-line cases when I went to school (I should have become a tester instead of a software developer! )

And I was trying to clear up some custom columns, and some custom columns had template errors due to that (mostly my test columns...)
Sweetpea is offline   Reply With Quote
Old 10-20-2010, 08:27 AM   #4
chaley
"chaley", not "charley"
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: 5,893
Karma: 1216548
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by Sweetpea View Post
Yep, it works.
Thanks.
Quote:
and they taught me to test all border-line cases when I went to school (I should have become a tester instead of a software developer! )
I agree, both on the testing and your predilection to do strange things. Unfortunately, the 100% goal is almost impossible to reach on complex systems, because the number of test cases is almost infinite.

The other problem is that we don't have a regression test platform for calibre. All of the template problems you have found actually did work at one point. The errors were introduced later, in these cases when fixing bugs or adding features in related areas. With the resources we have, it is more efficient to recruit users to help with the testing then to spend weeks trying (and failing) to do it ourselves.
chaley is offline   Reply With Quote
Old 10-20-2010, 08:38 AM   #5
Manichean
Wizard
Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!
 
Manichean's Avatar
 
Posts: 3,130
Karma: 80520
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
Quote:
Originally Posted by chaley View Post
The other problem is that we don't have a regression test platform for calibre. All of the template problems you have found actually did work at one point. The errors were introduced later, in these cases when fixing bugs or adding features in related areas. With the resources we have, it is more efficient to recruit users to help with the testing then to spend weeks trying (and failing) to do it ourselves.
But then again, the users helping in the development, and be it only via testing, is, in my eyes, one of the points of open source software.
Manichean is offline   Reply With Quote
Old 10-20-2010, 10:25 AM   #6
chaley
"chaley", not "charley"
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: 5,893
Karma: 1216548
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by Sweetpea View Post
Yep, it works.
Out of curiosity, was the database completely recovered, as far as you have seen?
chaley is offline   Reply With Quote
Old 10-20-2010, 10:37 AM   #7
chaley
"chaley", not "charley"
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: 5,893
Karma: 1216548
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by Manichean View Post
But then again, the users helping in the development, and be it only via testing, is, in my eyes, one of the points of open source software.
The active, involved community is one reason I enjoy working on calibre. The interesting ideas and (for me more important) the challenges the ideas create help keep the my brain from ossifying. As for testing, this user community comes up with extremely unexpected ways of using this program, and that too contributes to the challenge and fun. In the end, everyone wins. Can't beat that, really.
chaley is offline   Reply With Quote
Old 10-20-2010, 11:31 AM   #8
Sweetpea
Grand Sorcerer
Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.
 
Sweetpea's Avatar
 
Posts: 8,069
Karma: 22730000
Join Date: Dec 2008
Location: Krewerd
Device: AVTN8; BBMini; Onyx Boox T68; SGN8
Quote:
Originally Posted by chaley View Post
Out of curiosity, was the database completely recovered, as far as you have seen?
All, but the last update I did to my #file_name custom field. (I did something brilliant with my #version field which I can't repeat...) And I did have some template errors, but that was mostly because I now saw those fields (after my renaming spree in my custom columns )
Sweetpea is offline   Reply With Quote
Old 10-20-2010, 03:14 PM   #9
phenomshel
ZCD BombShel
phenomshel ought to be getting tired of karma fortunes by now.phenomshel ought to be getting tired of karma fortunes by now.phenomshel ought to be getting tired of karma fortunes by now.phenomshel ought to be getting tired of karma fortunes by now.phenomshel ought to be getting tired of karma fortunes by now.phenomshel ought to be getting tired of karma fortunes by now.phenomshel ought to be getting tired of karma fortunes by now.phenomshel ought to be getting tired of karma fortunes by now.phenomshel ought to be getting tired of karma fortunes by now.phenomshel ought to be getting tired of karma fortunes by now.phenomshel ought to be getting tired of karma fortunes by now.
 
phenomshel's Avatar
 
Posts: 4,737
Karma: 6180874
Join Date: Jan 2009
Location: The Frozen North (aka Illinois, USA)
Device: Dell Venue Pro 8
Quote:
Originally Posted by chaley View Post
The active, involved community is one reason I enjoy working on calibre. The interesting ideas and (for me more important) the challenges the ideas create help keep the my brain from ossifying. As for testing, this user community comes up with extremely unexpected ways of using this program, and that too contributes to the challenge and fun. In the end, everyone wins. Can't beat that, really.
Glad you enjoy it, because I don't see it stopping anytime soon....or ever. I sometimes feel guilty about asking "how do I do this?" or "this person got this result, but I get that result, why?" and similar things, not to mention my well known penchant for loving my eye candy in my software - which I'm aware that a lot of developers, especially Linux developers - hate. (I know this because I had a run-in with KMail devs...don't ask, it wasn't pretty....*grin*).
I don't think you ever have to worry about your brain ossifying Charles. I read your CV online (in your sig.). You probably have brain power to spare for half the forum!
phenomshel is offline   Reply With Quote
Old 10-20-2010, 04:58 PM   #10
chaley
"chaley", not "charley"
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: 5,893
Karma: 1216548
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by phenomshel View Post
Glad you enjoy it ...
How kind.

OFF TOPIC ALERT

Next cats will be our first ones. Our very first was the only male in a friend's queen's unexpected litter of 5 (they delayed spaying her a bit too long). He was a wonderful cat, smart and affectionate, and lived to 20. The second was a rescue cat, found when 3 weeks old (according to the vet). She was so young that she didn't know how to care for herself. She knew what the box was for, but didn't know to keep her paws out of the mess. Fortunately we had our first, and he dealt with the problem. It was very amusing to see him teach her how to bathe. We were instructed to feed her baby food for some weeks. Weaning her away from it was not fun...
chaley is offline   Reply With Quote
Old 10-20-2010, 05:16 PM   #11
phenomshel
ZCD BombShel
phenomshel ought to be getting tired of karma fortunes by now.phenomshel ought to be getting tired of karma fortunes by now.phenomshel ought to be getting tired of karma fortunes by now.phenomshel ought to be getting tired of karma fortunes by now.phenomshel ought to be getting tired of karma fortunes by now.phenomshel ought to be getting tired of karma fortunes by now.phenomshel ought to be getting tired of karma fortunes by now.phenomshel ought to be getting tired of karma fortunes by now.phenomshel ought to be getting tired of karma fortunes by now.phenomshel ought to be getting tired of karma fortunes by now.phenomshel ought to be getting tired of karma fortunes by now.
 
phenomshel's Avatar
 
Posts: 4,737
Karma: 6180874
Join Date: Jan 2009
Location: The Frozen North (aka Illinois, USA)
Device: Dell Venue Pro 8
Quote:
Originally Posted by chaley View Post
How kind.

OFF TOPIC ALERT

Next cats will be our first ones. Our very first was the only male in a friend's queen's unexpected litter of 5 (they delayed spaying her a bit too long). He was a wonderful cat, smart and affectionate, and lived to 20. The second was a rescue cat, found when 3 weeks old (according to the vet). She was so young that she didn't know how to care for herself. She knew what the box was for, but didn't know to keep her paws out of the mess. Fortunately we had our first, and he dealt with the problem. It was very amusing to see him teach her how to bathe. We were instructed to feed her baby food for some weeks. Weaning her away from it was not fun...
Cool. I love your cat avatars, Charles. Someday I'll tell you about my cats...past and present.
phenomshel is offline   Reply With Quote
Old 10-20-2010, 05:45 PM   #12
Manichean
Wizard
Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!Manichean My eyes! My eyes! The light is just too bright!
 
Manichean's Avatar
 
Posts: 3,130
Karma: 80520
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
Quote:
Originally Posted by chaley View Post
[...]As for testing, this user community comes up with extremely unexpected ways of using this program, and that too contributes to the challenge and fun.[...]
Yeah, I'm frequently amused by what people try to do. Amused and impressed, often both at once.
Manichean is offline   Reply With Quote
Old 10-21-2010, 02:58 AM   #13
Sweetpea
Grand Sorcerer
Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.
 
Sweetpea's Avatar
 
Posts: 8,069
Karma: 22730000
Join Date: Dec 2008
Location: Krewerd
Device: AVTN8; BBMini; Onyx Boox T68; SGN8
To go a bit more on-topic:

I made a backup of my Calibre database yesterday and promised myself to do so more often (especially after playing with it!) It's still the best way of rolling back things
Sweetpea is offline   Reply With Quote
Old 10-21-2010, 05:00 AM   #14
chaley
"chaley", not "charley"
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: 5,893
Karma: 1216548
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by Sweetpea View Post
I made a backup of my Calibre database yesterday and promised myself to do so more often (especially after playing with it!) It's still the best way of rolling back things
Yes, it is, but you must keep in mind that restoring an older db can break db/file system synchronization. If a title or an author was changed between the backup and the restore, then the file system will reflect the new data but the db will reflect the old. Calibre will be unable to find the formats or covers for books in this state.

You can use check library to find these problems. In most cases (all that I can think of), you can recover by renaming the 'extra authors/titles' to what calibre wants them to be, which will be shown in 'missing authors/titles'.
chaley is offline   Reply With Quote
Old 10-21-2010, 07:50 AM   #15
Sweetpea
Grand Sorcerer
Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.Sweetpea ought to be getting tired of karma fortunes by now.
 
Sweetpea's Avatar
 
Posts: 8,069
Karma: 22730000
Join Date: Dec 2008
Location: Krewerd
Device: AVTN8; BBMini; Onyx Boox T68; SGN8
Quote:
Originally Posted by chaley View Post
Yes, it is, but you must keep in mind that restoring an older db can break db/file system synchronization. If a title or an author was changed between the backup and the restore, then the file system will reflect the new data but the db will reflect the old. Calibre will be unable to find the formats or covers for books in this state.

You can use check library to find these problems. In most cases (all that I can think of), you can recover by renaming the 'extra authors/titles' to what calibre wants them to be, which will be shown in 'missing authors/titles'.
Oh, I didn't mean the .db file only... I meant the entire Calibre DB. I already had a backup, but that one was so old (2 weeks, at least!) that it was horribly outdated...
Sweetpea is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Old Thread] Calibre Backup and Restore Timber Calibre 21 06-01-2011 08:31 PM
PRS-600 Backup and Restore of Notes raymondchen625 Sony Reader 1 12-21-2009 12:49 AM
any one has kindle dx restore firmware?? chinaet Kindle Developer's Corner 0 07-25-2009 06:14 AM
iLiad Backup / Restore ? ce3po iRex Developer's Corner 3 11-18-2007 06:53 PM


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


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