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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 11-13-2012, 06:46 AM   #1
Matsendrasana
Member
Matsendrasana began at the beginning.
 
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.

Matsendrasana is offline   Reply With Quote
Old 11-13-2012, 07:14 AM   #2
speakingtohe
Wizard
speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.speakingtohe ought to be getting tired of karma fortunes by now.
 
Posts: 4,633
Karma: 25186576
Join Date: Apr 2010
Device: sony PRS-T1 and T3, Kobo Mini and Aura HD, Tablet
Quote:
Originally Posted by Matsendrasana View Post
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.


If you have your documents as rtf in calibre, you should be able to edit them from within calibre by double clicking on them.

Helen
speakingtohe is offline   Reply With Quote
 
Advertisement
Old 11-13-2012, 08:46 AM   #3
theducks
Grand Sorcerer
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: 15,250
Karma: 6020307
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by Matsendrasana View Post
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.

Portable has its own, tighter, less flexible rules than the regular installed version.
As to your folders vs Calibre: http://www.mobileread.com/forums/sho...d.php?t=119175
theducks is offline   Reply With Quote
Old 11-13-2012, 08:58 AM   #4
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,908
Karma: 12755553
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by Matsendrasana View Post
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.
Calibre portable is designed to be run from a USB drive, as such it has this limitation. If you want to place your library anywhere use calibre instead.

Quote:
Originally Posted by Matsendrasana View Post
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.
Import the doc into calibre once, then use the "Open with" plugin to open the doc in LibreOffice. Save when finished and transfer the doc to your reader. Wash, rinse, repeat.

Quote:
Originally Posted by Matsendrasana View Post
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.
You're entitled to your opinion and certainly there are always different ways to do things, but each library is unique unto itself. Having the one file (metadata.db) included with each library you have ensures backing calibre up is a simple one directory process. For most users having the metadata.db file in the root of their library isn't something they are aware of.

Quote:
Originally Posted by Matsendrasana View Post
The price for that, however, is that you have to grant it exclusive access to your files, loosing even the ability to edit them.
This statement just isn't accurate. As I stated above you never loose the ability to edit your files. I frequently edit my epub books and my cover images using the Open With plugin.

Good Reading.

Last edited by DoctorOhh; 11-13-2012 at 09:08 AM.
DoctorOhh is online now   Reply With Quote
Old 11-13-2012, 03:08 PM   #5
Matsendrasana
Member
Matsendrasana began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Nov 2012
Device: none
Quote:
Originally Posted by DoctorOhh View Post
This statement just isn't accurate. As I stated above you never loose the ability to edit your files. I frequently edit my epub books and my cover images using the Open With plugin.
Thanks. If I understood correctly this plugin allows me to open LibreOffice from Calibre? However, I don't want to store my work in Calibre's opaque and arbitary directory structure. I feel it is made for static files, but is not flexible enough for autors.

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.
Matsendrasana is offline   Reply With Quote
Old 11-13-2012, 09:05 PM   #6
theducks
Grand Sorcerer
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: 15,250
Karma: 6020307
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
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 ).
theducks is offline   Reply With Quote
Old 11-19-2012, 03:55 PM   #7
Matsendrasana
Member
Matsendrasana began at the beginning.
 
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
We can also use LibreOffice's EPUB conversion, which I presume employs epub2writer since I have this tool installed. However, I found that ebook-convert.exe creates nicer output that looks much like the original.

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
Alas, this works only the first time. Then it complains that the book already exists in the database. The --duplicate option is no help because it will just add a 2nd, 3rd etc. instance of the same book! calibredb misses a replace command. The remove command is not flexible enough since it expects some unknown numerical ids. The list command will shows these ids in a human-readable form only, i.e. I see no way to extract the id in question from its output. Since calibredb notices that the book is a duplicate, however, it should be very easy to replace it.

So please, can anybody help out here?

Last edited by Matsendrasana; 11-19-2012 at 04:01 PM.
Matsendrasana is offline   Reply With Quote
Old 11-19-2012, 10:35 PM   #8
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: 26,434
Karma: 5383257
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.
kovidgoyal is offline   Reply With Quote
Old 11-19-2012, 11:14 PM   #9
SampleAndy
Addict
SampleAndy ought to be getting tired of karma fortunes by now.SampleAndy ought to be getting tired of karma fortunes by now.SampleAndy ought to be getting tired of karma fortunes by now.SampleAndy ought to be getting tired of karma fortunes by now.SampleAndy ought to be getting tired of karma fortunes by now.SampleAndy ought to be getting tired of karma fortunes by now.SampleAndy ought to be getting tired of karma fortunes by now.SampleAndy ought to be getting tired of karma fortunes by now.SampleAndy ought to be getting tired of karma fortunes by now.SampleAndy ought to be getting tired of karma fortunes by now.SampleAndy ought to be getting tired of karma fortunes by now.
 
SampleAndy's Avatar
 
Posts: 248
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!
SampleAndy is offline   Reply With Quote
Old 11-20-2012, 04:51 AM   #10
Matsendrasana
Member
Matsendrasana began at the beginning.
 
Posts: 12
Karma: 10
Join Date: Nov 2012
Device: none
Quote:
Originally Posted by kovidgoyal View Post
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.
In fact text parsing and processing is probably the favorite thing I do with a computer, and Cygwin I use since 1999. This is why I found it hard to parse calibredb's output:
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
Names are separated by blanks. It is hard to tell when the book title ends and the author begins, because the fields id, title and author are not tab-separated. They're separated by blanks like words in the title and the author fields. Furthermore some titles are broken into separate lines (3, 15). Also title and author seem to have no fixed columns. In the output the title/author currently starts at the odd positions column 3/61. What if id > 99?

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 04:56 AM.
Matsendrasana is offline   Reply With Quote
Old 11-20-2012, 05:04 AM   #11
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: 26,434
Karma: 5383257
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Once again

calibredb list -h
calibredb add_format -h
ebook-meta -h
kovidgoyal is offline   Reply With Quote
Old 11-20-2012, 05:57 AM   #12
Matsendrasana
Member
Matsendrasana began at the beginning.
 
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.

Quote:
Originally Posted by kovidgoyal View Post
calibredb list -h
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.

Quote:
Originally Posted by kovidgoyal View Post
calibredb add_format -h
Requires an id which is unknown. There're only files, and...

Quote:
Originally Posted by kovidgoyal View Post
ebook-meta -h
...has no option to extract the title.

What am I missing?
Matsendrasana is offline   Reply With Quote
Old 11-20-2012, 06:06 AM   #13
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: 26,434
Karma: 5383257
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
kovidgoyal is offline   Reply With Quote
Old 11-20-2012, 06:08 AM   #14
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: 26,434
Karma: 5383257
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
And in case you dont want to use --dont-notify-gui

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 06:13 AM.
kovidgoyal is offline   Reply With Quote
Old 11-20-2012, 06:31 AM   #15
Matsendrasana
Member
Matsendrasana began at the beginning.
 
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 06:42 AM.
Matsendrasana 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
Suggestion: change default library folder location so it's backed up by Win7 Backup robcohen Devices 2 02-24-2012 02:50 AM
Can I change library folder names? lizzielou Library Management 2 01-23-2012 12:49 PM
Moving library folder outside calibre - than change within. myle00 Calibre 6 08-16-2011 08:08 AM
Want to change the folder structure of the Calibre library? Manichean Library Management 0 01-30-2011 11:51 AM
Change the folder where News are sent Walkmancho Calibre 0 07-07-2010 02:22 AM


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


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