View Single Post
Old 12-05-2015, 11:16 PM   #10
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Well, it looks like calibre doesn't optimize the copyfileobj buffer size for large files, which would help a little at least.

Although copying GBs at a time is not going to be pleasant, so I understand why you would rather move them.


...


calibre "supports" files that aren't named "correctly" -- the database holds a reference to the final pathname, since sometimes calibre shortens the filename to work around issues with various os/fs combos.
So a database restore should pick up each uniquely-suffixed file, and add them properly. As you've seen.

As Kovid says you are relying on undocumented trickery which might not be the best way of dealing with calibre. Also, metadata changes in calibre will recalculate the filenames and move them -- so in case anyone thinks this is a way to get around calibre's library structure, think again!
But it *should* be all right. Given that there is already a limited flexibility in the structure, it should serve to add the book at least. I cannot promise what parts of calibre might depend on a heuristic view of the filepath though. Restore/integrity-checking might complain, for instance -- and certainly will if you try pushing it any further!
And it really does strike me as a pretty slow way of dealing with the issue, as a database restore is not exactly fast itself.
eschwartz is offline   Reply With Quote