11-13-2012, 05:46 AM | #1 |
Member
Posts: 12
Karma: 10
Join Date: Nov 2012
Device: none
|
Can't change library folder
Hi, I'm using Calibre 0.9.6 Portable under Windows. After moving the library from ...\Calibre\Calibre Library to something else, and restarting Calibre, it insists on the old location. I have to manually switch it each time now.
My other question is how books can be imported better. I understand that Calibre needs to maintain a database, but to force users to copy everything into a static folder is far too strict to be generally useful. For example, I have LibreOffice documents I am working on, and like these to be available under Calibre as well. But I cannot rereimport these documents again and again after doing changes, so I would like to have Calibre them know by reference. So I can copy draft versions to my Sony Reader. In fact, IMHO Calibre is rather unusable as a library manager without being able to handle arbitary pathnames. Throwing both, database + content into the same fixed and opaque folder hierarchy is far too strict. Take, for example, image database applications like Photoshop Elements, Lightroom or IMatch. For good reasons none of them forces user-images to be mixed with their private (thus finally irrelevant) database files. Calibre is a great and powerful tool. The price for that, however, is that you have to grant it exclusive access to your files, loosing even the ability to edit them. |
11-13-2012, 06:14 AM | #2 | |
Wizard
Posts: 4,812
Karma: 26912940
Join Date: Apr 2010
Device: sony PRS-T1 and T3, Kobo Mini and Aura HD, Tablet
|
Quote:
Helen |
|
11-13-2012, 07:46 AM | #3 | |
Well trained by Cats
Posts: 29,791
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:
As to your folders vs Calibre: https://www.mobileread.com/forums/sho...d.php?t=119175 |
|
11-13-2012, 07:58 AM | #4 | ||||
US Navy, Retired
Posts: 9,864
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Nexus 7
|
Quote:
Quote:
Quote:
Quote:
Good Reading. Last edited by DoctorOhh; 11-13-2012 at 08:08 AM. |
||||
11-13-2012, 02:08 PM | #5 | |
Member
Posts: 12
Karma: 10
Join Date: Nov 2012
Device: none
|
Quote:
For example, I use Asciidoc a lot. With Calibre I am supposed to put my projects (with dozens of input text files and images) under the library directory, just to help Calibre see the PDF/EPUB/HTML output Asciidoc generates. This makes no sense. Some documents are part of software projects I work on (under .../prj/path/to/project), others are just articles and other text (under .../doc/texte/, .../doc/thema/ etc.). Not to mention the fact that the portable version requires everything to be on the stick... Finally, it should be no problem for Calibre to store references (pathnames) in its database, and, if they exist, re-read these files at startup. |
|
11-13-2012, 08:05 PM | #6 |
Well trained by Cats
Posts: 29,791
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Using your requirements: You need to look for some other program. Calibre's author is not going to change the overall method of keeping files (again. IIRC someone said the original Calibre used BLOB's to store books. Performance was ).
|
11-19-2012, 02:55 PM | #7 |
Member
Posts: 12
Karma: 10
Join Date: Nov 2012
Device: none
|
Another program is no option.
I tried to write a batch script that would import my documents to Calibre. First it uses LibreOffice to create the PDF and Calibre's ebook_convert to create an EPUB from an ODT (LibreOffice Writer file). Code:
> soffice.exe --headless --convert-to pdf --outdir /path/to/output /path/to/file.odt > ebook-convert.exe /path/to/file.odt /path/to/output/file.epub So the conversion part was suprisingly simple. Of course my batch-file is a bit more complex since I use an abstract subroutine for this task that dequotes pathnames, extracts the file basenames etc. The next thing I had to do was to update Calibre's database. The essential command is: Code:
calibredb.exe add --with-library /path/to/calibre-lib /path/to/output/file.epub So please, can anybody help out here? Last edited by Matsendrasana; 11-19-2012 at 03:01 PM. |
11-19-2012, 09:35 PM | #8 |
creator of calibre
Posts: 43,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
calibredb add_format -h
And you need to learn how to use tools to parse text output. Install cygwin and use grep, cut, and tr tools to get ids. |
11-19-2012, 10:14 PM | #9 |
Addict
Posts: 271
Karma: 644344
Join Date: Oct 2012
Location: Pittsburgh, PA, USA
Device: KPW, KFire HD, KFire, KTD 3g, KT, K4B, K4S, K3g, K3g SO, K2, K1
|
If I read the posts above correctly, I think I found the answer to my question. The reason I couldn't find how to set the default database to point to something other than X:\Program Files\Calibre Portable\Calibre Library is because the program was designed to find the database in a specific path, which cannot be changed. It will always look for the database in the folder Calibre Library below the Calibre Portable folder.
Please let me know if I am correct, and thanks again for your help! |
11-20-2012, 03:51 AM | #10 | |
Member
Posts: 12
Karma: 10
Join Date: Nov 2012
Device: none
|
Quote:
Code:
id title authors 3 Exchangeable image file format for digital still cameras: Unbekannt Exif Version 2.2 6 R4 Bedienungsanleitung PDFCreator 7 R9 Bedienungsanleitung Unbekannt 9 E-1 Bedienungsanleitung asanuma 10 E-5 Bedienungsanleitung (DE) bartdr 15 Financial Applications Using Excel Add-in Development in Steve Dalton C/C++ 16 Auszüge aus den Bramahnas und Upanishaden Alfred Hillebrandt 17 Markandeya Purana Jens Grünewald 22 The CRAY-2 Computer System, 1985 Unbekannt 25 Devi-Mahatmya Klaus Mailahn Finally, how to get the title of my own files? exiftool -title will extract the title as one-liner for PDFs but not for EPUBs. ebook-meta --title can only set the title, but not read it. Correct? calibredb refuses to import an EPUB when its title is already used. When this is true, isn't it then easier, and less error-prone, to leave title comparison in the hands of calibredb? Parsing titles should be used by a script to decide if the --duplicate option must be applied, and along with that, another option would be handy that replaces the book instead of creating a new instance. Both are legal cases when working with the cli-tools (which are really great!). Last edited by Matsendrasana; 11-20-2012 at 03:56 AM. |
|
11-20-2012, 04:04 AM | #11 |
creator of calibre
Posts: 43,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Once again
calibredb list -h calibredb add_format -h ebook-meta -h |
11-20-2012, 04:57 AM | #12 |
Member
Posts: 12
Karma: 10
Join Date: Nov 2012
Device: none
|
Kovid, of course I tried them all. I can see no way to do this. Please help.
No further options here. To get the title of a book (and thus its id) the list format is very hard to parse. The easiest way is probably some separate Perl/Python script that would deduce the columns from the id/title/author columns. Requires an id which is unknown. There're only files, and... ...has no option to extract the title. What am I missing? |
11-20-2012, 05:06 AM | #13 |
creator of calibre
Posts: 43,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
It really isn't my job to teach you how to use the CLI, but, since I needed a five minute break anyway...
Code:
id = `calibredb add test.html --duplicates | grep "Added book ids" | tail -n1 | cut -d":" -f2` calibredb add_format $id someotherformat.epub ebook-meta file.mobi | grep '^Title' | head -n1 | cut -d":" -f 2 |
11-20-2012, 05:08 AM | #14 |
creator of calibre
Posts: 43,850
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Or even simpler
Code:
id=`calibredb add /t/test.html --dont-notify-gui | tail -n1 | cut -d: -f2` calibredb add_format $id someotherformat.epub Code:
id=`calibredb add /t/test.html | tail -n2 | head -n1 | cut -d: -f2` calibredb add_format $id someotherformat.epub Last edited by kovidgoyal; 11-20-2012 at 05:13 AM. |
11-20-2012, 05:31 AM | #15 |
Member
Posts: 12
Karma: 10
Join Date: Nov 2012
Device: none
|
Maybe I have not made clear what I try to accomplish: I do not want to add another format, and did not asked for detailed command-lines. I just want to replace a present book in the same format because its source (LibreOffice, Asciidoc etc.) has changed. To do this an id is required. Here is explained: "You can get id by using the list command."
But as I posted by example the output of this command is hard to parse, and also the title from the newly added files must be known to extract the id from the list output. Nevertheless I tried adding the book and parse the messages: no luck. As you showed, it only tells the id when adding a new book. When the book already exists it just prints an error. And with --duplicates it prints the new id. Last edited by Matsendrasana; 11-20-2012 at 05:42 AM. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Suggestion: change default library folder location so it's backed up by Win7 Backup | robcohen | Devices | 2 | 02-24-2012 01:50 AM |
Can I change library folder names? | lizzielou | Library Management | 2 | 01-23-2012 11:49 AM |
Moving library folder outside calibre - than change within. | myle00 | Calibre | 6 | 08-16-2011 07:08 AM |
Want to change folder structure or file names in the Calibre library? | Manichean | Library Management | 0 | 01-30-2011 10:51 AM |
Change the folder where News are sent | Walkmancho | Calibre | 0 | 07-07-2010 01:22 AM |