09-28-2011, 09:50 AM | #1 |
Wizard
Posts: 1,065
Karma: 858115
Join Date: Jan 2011
Device: Kobo Clara, Kindle Paperwhite 10
|
Identified "losing books" behavior with Save To Disk
A couple months ago I mentioned I was losing some books occasionally during Save/Add operations to populate new empty libraries, with Automerge off, and Yes to add duplicates. I finally pinned down this behavior. It happens in Save To Disk from Library 1, not in Add Books to Library 2. Add Books can't find what Save To Disk didn't put there.
In two separate records, if Authors matches Authors AND Title matches Title, one of those records is dropped during the Save To Disk. This happens when the Authors and Title combinations are identical, independently of any other fields, including IDs. For example, 2 books are both Saved when they have identical ISBN13s and unique Authors or unique Titles; but 2 books are not Saved when Authors/Title combination keys aren't unique even when their ISBN13s are unique. Copy To Library does NOT have this behavior, it Copies both records when their Authors/Title match. This isn't necessarily a bug with Save To Disk, but it's something to keep in mind. The work-around for Save To Disk is: within any particular Authors, append something different to identical Titles to make each Title unique, such as "(from Amazon)" on one and "(from Gutenberg)" on the other. Or, use Copy To Library from Library 1 to Library 2, rather than a Save To Disk from Library 1 followed by an Add Books to Library 2. Last edited by unboggling; 09-29-2011 at 12:24 PM. Reason: clarify |
09-29-2011, 11:02 AM | #2 | |||||
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
Quote:
Quote:
Quote:
Quote:
|
|||||
Advert | |
|
09-29-2011, 12:03 PM | #3 | |
Grand Sorcerer
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
|
|
09-29-2011, 01:30 PM | #4 | ||||||
Wizard
Posts: 1,065
Karma: 858115
Join Date: Jan 2011
Device: Kobo Clara, Kindle Paperwhite 10
|
Quote:
Quote:
Code:
{author_sort}/{title}/{title} - {authors} Quote:
Quote:
Quote:
Quote:
Code:
{author_sort}/{title}/{title} - {authors} - (({id})) Last edited by unboggling; 09-29-2011 at 01:39 PM. Reason: clarify |
||||||
09-29-2011, 01:36 PM | #5 |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
This is a good idea, and a lot easier than maintaining a custom column, if he doesn't mind adding ID to all saved books. I was trying to suggest something that wouldn't change his default filename except when there was a duplicate.
|
Advert | |
|
09-29-2011, 01:46 PM | #6 | |
Wizard
Posts: 1,065
Karma: 858115
Join Date: Jan 2011
Device: Kobo Clara, Kindle Paperwhite 10
|
Quote:
btw, anybody, off topic but since I have your attention at the moment: Which do you think is a better title between the following two, for what I still think of as "KISS posts" in my KISS thread? Workflow with Examples for New calibre Users or KISS for New calibre Users Edit: (The number of hits dropped significantly when I changed the title from KISS.) Last edited by unboggling; 09-29-2011 at 01:50 PM. |
|
09-29-2011, 02:19 PM | #7 |
Wizard
Posts: 1,065
Karma: 858115
Join Date: Jan 2011
Device: Kobo Clara, Kindle Paperwhite 10
|
How would I change my Add Books regex to strip off the id in the title? Sorry, I don't understand regex well enough to figure it out by myself yet… Here's the new save template:
Code:
{author_sort}/{title}/{title} - {authors} - (({id})) Code:
(?P<author>[^_-]+) -?\s*(?P<series>[^_0-9-]*)(?P<series_index>[0-9]*)\s*-\s*(?P<title>[^_].+) ? Last edited by unboggling; 09-29-2011 at 02:31 PM. |
09-29-2011, 02:47 PM | #8 | |
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
Code:
{author_sort}/{title}/{title} - {authors} - (({id})) Code:
- \(\(\d+\)\) |
|
09-29-2011, 10:28 PM | #9 | ||
Wizard
Posts: 1,065
Karma: 858115
Join Date: Jan 2011
Device: Kobo Clara, Kindle Paperwhite 10
|
Quote:
Quote:
For Save template, I went with single parentheses instead of double parentheses around the "{id}". I like that the {id} makes any saved book-record's filename unique so solves any OS filename conflict problems for identical Authors/Titles. This is what I decided to use as Save Template for now: Code:
{author_sort}/{title}/{authors} - {series}{series_index:0>2s| | - }{title} - ({id}) Code:
(?P<author>[^_-]+) -?\s*(?P<series>[^_0-9-]*)(?P<series_index>[0-9]*)\s*-\s*(?P<title>[^_].+) ? Code:
(?P<author>[^_]+?) - ((?P<series>.*) (?P<series_index>[0-9]*) - )?(?P<title>.+) For Add reading from filename, trying various permutations of "( - \(\d+\))" on various Add regexs, I couldn't get any to work in all cases of has ID versus doesn't have ID, only for has but not doesn't have, and vice versa. I was probably doing something wrong in my regex noobness, but couldn't make any of these work well in enough cases (listing for illustration purposes just a few attempts with just the simpler Add regex): Code:
(?P<author>[^_]+?) - ((?P<series>.*) (?P<series_index>[0-9]*) - )?(?P<title>.+)(| - \(\d+\)|)?? (?P<author>[^_]+?) - ((?P<series>.*) (?P<series_index>[0-9]*) - )?(?P<title>.+)(| - \(\d+\)|)? (?P<author>[^_]+?) - ((?P<series>.*) (?P<series_index>[0-9]*) - )?(?P<title>.+)( - \(\d+\))? (?P<author>[^_]+?) - ((?P<series>.*) (?P<series_index>[0-9]*) - )?(?P<title>.+)( - \(\d+\)) I'd appreciate it if anyone can explain what I was doing wrong with the "\d+" phrasing or anything else. Last edited by unboggling; 09-29-2011 at 10:35 PM. Reason: clean-up |
||
09-29-2011, 11:26 PM | #10 | |
Wizard
Posts: 1,065
Karma: 858115
Join Date: Jan 2011
Device: Kobo Clara, Kindle Paperwhite 10
|
Quote:
So, my newest and better Save template is now: Code:
{author_sort}/{title} - ({id})/{authors} - {series}{series_index:0>2s| | - }{title} Last edited by unboggling; 09-29-2011 at 11:30 PM. |
|
09-30-2011, 10:01 AM | #11 | ||
Wizard
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
|
Quote:
I know you've settled on using ID in the folder, but I wondered why the regexes you posted didn't work, so I tested this one from your list: Code:
(?P<author>[^_]+?) - ((?P<series>.*) (?P<series_index>[0-9]*) - )?(?P<title>.+)( - \(\d+\)) Quote:
|
||
09-30-2011, 12:40 PM | #12 |
Wizard
Posts: 1,065
Karma: 858115
Join Date: Jan 2011
Device: Kobo Clara, Kindle Paperwhite 10
|
That's one of the exact same add regexs I tried. It worked for cases where filename had the appended ID, as in
Code:
unboggling iBoggle - Regex 01 - Regex Difficulties - (123) |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
"Save single format to disk" trouble | vbdasc | Calibre | 2 | 12-01-2010 02:30 AM |
Propagate a new "Save to Disk" Folder Structure using Calibre? | Trickery | Calibre | 3 | 09-11-2010 09:27 PM |
Do I misunderstand "Save to Disk" ? | columbus | Calibre | 7 | 07-28-2010 10:31 AM |
Confusion about "Save to Disk" and Calibre libraries? | jesscat | Calibre | 10 | 03-22-2010 01:04 PM |
Can I use "Save to disk" and updat the cover? | pwarning | Calibre | 1 | 03-21-2010 11:28 PM |