Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 05-31-2015, 08:09 PM   #1
loviedovie
Addict
loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.
 
Posts: 295
Karma: 2139988
Join Date: Nov 2014
Device: bookeen
How can I force Calibre to add formats that are added manually to the respective f?

Hi

I created a script that converts pdf files to djvu files and copies them to their respective folders. It is all fine but is there a way to get Calibre to ad those dangling files to the proper book database ?


The djvu files are in the same folder as the original pdf files.


thanks
loviedovie is offline   Reply With Quote
Old 05-31-2015, 10:02 PM   #2
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: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
http://manual.calibre-ebook.com/cli/calibredb.html
kovidgoyal is offline   Reply With Quote
Advert
Old 05-31-2015, 10:17 PM   #3
loviedovie
Addict
loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.
 
Posts: 295
Karma: 2139988
Join Date: Nov 2014
Device: bookeen
@kovidgoyal

Thanks for the pointers. looked at the available possiblities and it might work out however I think I am missing one crucial information. I need a way to pass an id to calibredb and get the actual path of the book.

It is a bit convoluted to me. I have djvu files named exactly same as the pdf except that it has a djvu extension. So in this respect do you have a recommendation for me to go for as far as the scripting logic goes?


thanks
loviedovie is offline   Reply With Quote
Old 05-31-2015, 10:40 PM   #4
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: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The ids are part of the folder names, you can easily parse them out from there.
kovidgoyal is offline   Reply With Quote
Old 05-31-2015, 11:09 PM   #5
loviedovie
Addict
loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.
 
Posts: 295
Karma: 2139988
Join Date: Nov 2014
Device: bookeen
Quote:
Originally Posted by kovidgoyal View Post
The ids are part of the folder names, you can easily parse them out from there.
Hi

Is the ID the folder name or the number which comes up when I use list command?
loviedovie is offline   Reply With Quote
Advert
Old 06-01-2015, 01:55 AM   #6
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,553
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
Quote:
Originally Posted by loviedovie View Post
Hi

Is the ID the folder name or the number which comes up when I use list command?
The number in brackets in the folder name should be the same as the value that is given by the list command
itimpi is offline   Reply With Quote
Old 06-01-2015, 02:21 AM   #7
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: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
And you can use

calibredb list -f formats --for-machine --search=id:book_id

to get the path of all ebook files for a book in JSON format given the book id

Last edited by kovidgoyal; 06-01-2015 at 02:23 AM.
kovidgoyal is offline   Reply With Quote
Old 06-01-2015, 12:41 PM   #8
loviedovie
Addict
loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.
 
Posts: 295
Karma: 2139988
Join Date: Nov 2014
Device: bookeen
thanks for your help, I guess I have to move to Python from Bash to wrap this up.
loviedovie is offline   Reply With Quote
Old 06-01-2015, 02:41 PM   #9
theducks
Well trained by Cats
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: 31,047
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by loviedovie View Post
thanks for your help, I guess I have to move to Python from Bash to wrap this up.
Python??
That is a commandline
theducks is offline   Reply With Quote
Old 06-01-2015, 06:13 PM   #10
loviedovie
Addict
loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.
 
Posts: 295
Karma: 2139988
Join Date: Nov 2014
Device: bookeen
Quote:
Originally Posted by theducks View Post
Python??
That is a commandline
Well, not sure how I can parse JSON with Bash so I have to make it a .py script.
loviedovie is offline   Reply With Quote
Old 06-01-2015, 07:44 PM   #11
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,720
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by loviedovie View Post
Well, not sure how I can parse JSON with Bash so I have to make it a .py script.
@loviedovie - maybe you could extract the book id from the book folders where the djvu's are located, or perhaps move the djvu files to another folder en-masse, and then use Add books from a single directory with the Automerge setting checked in Preferences->Add books->The Add Process

BR
BetterRed is offline   Reply With Quote
Old 06-01-2015, 08:33 PM   #12
loviedovie
Addict
loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.
 
Posts: 295
Karma: 2139988
Join Date: Nov 2014
Device: bookeen
Quote:
Originally Posted by BetterRed View Post
@loviedovie or perhaps move the djvu files to another folder en-masse, and then use Add books from a single directory with the Automerge setting checked in Preferences->Add books->The Add Process

BR
Good idea but it does not work ;( I wonder maybe it is because most of the files have file names with spaces? This idea should work because the name of the djvu file is exactly the same except the extension.


Here is a djvu
"The artistic anatomy of trees, their struc - Cole, Rex Vicat, b. 1870.djvu"

and the pdf
"The artistic anatomy of trees, their struc - Cole, Rex Vicat, b. 1870.pdf"

I was thinking that maybe the regex was failing but I did the test and the regex in the add settings seems to catch stuff properly based on the example above. Calibre has the exact records for it based on the regex splitting. Peculiar.

Btw the reason I am going for Djvu because scanned Pdfs are painfully slow and I find Djvu to be much faster format both on mobile and desktop.

Last edited by loviedovie; 06-01-2015 at 08:41 PM.
loviedovie is offline   Reply With Quote
Old 06-01-2015, 08:48 PM   #13
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,720
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by loviedovie View Post
Good idea but it does not work ;( I wonder maybe it is because most of the files have file names with spaces? This idea should work because the name of the djvu file is exactly the same except the extension.


Here is a djvu
"The artistic anatomy of trees, their struc - Cole, Rex Vicat, b. 1870.djvu"

and the pdf
"The artistic anatomy of trees, their struc - Cole, Rex Vicat, b. 1870.pdf"

Btw the reason I am going for Djvu because scanned Pdfs are painfully slow and I find Djvu to be much faster format both on mobile and desktop.
@loviedovie - I think you'll need use the 'get metadata from file name' setting, with the an appropriate regex, this one should work - (?P<title>[^_]+) - (?P<author>.+) - should be in the drop down list. I did something similar a long time ago, as I recall it worked fine.

If there aren't too many you could just open each book folder - press 'O' - then drag 'n' drop the djvu file onto the book details. I do it every day with a dozen or so PRC files converted from PDF's with mobi creator.

BR
BetterRed is offline   Reply With Quote
Old 06-01-2015, 09:01 PM   #14
loviedovie
Addict
loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.loviedovie ought to be getting tired of karma fortunes by now.
 
Posts: 295
Karma: 2139988
Join Date: Nov 2014
Device: bookeen
BetterRed

Thanks for the suggestions. I have 375 Djvu files and more will be on the way later. I also used the same regex as the one you gave. I wonder if this has more of an issue with the Caibre's djvu format treatment.
loviedovie is offline   Reply With Quote
Old 06-02-2015, 03:30 AM   #15
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,720
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by loviedovie View Post
I wonder if this has more of an issue with the Caibre's djvu format treatment.
@loviedovie - Maybe - I've never had any dvju format files.

But I suspect the problem is that the file name contains 'truncated' titles as in - "The artistic anatomy of trees, their struc" whereas the title in the metadata is presumably "The artistic anatomy of trees, their structure & treatment in painting".

I'm not sure what constitutes a 'duplicate' in the Add process. What happens if the title & author are not truncated in the file name, e.g - "Some Title - Some Author.djvu"

BR
BetterRed is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Manually tweak date (& time?) added? Snorkledorf Library Management 1 04-09-2014 09:37 AM
Manually add a TOC entry p3aul Sigil 4 06-13-2012 08:22 AM
Manually adding different formats of a book murali Calibre 4 12-02-2010 02:17 PM
Force Calibre not to add Page Breaks on H1 and H2 Tags jloakes Calibre 2 11-18-2010 04:08 PM
How can I add multiple formats (without converting) and have Calibre see them? strannik Calibre 4 02-03-2010 05:49 PM


All times are GMT -4. The time now is 11:01 PM.


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