Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
Old 11-02-2014, 01:30 AM   #1
sthuck
Junior Member
sthuck began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Nov 2014
Device: none
Where copying to library is done in calibre

Hey everyone,

I'm a beginner programer who just so happens to like Calibre very much, and would like to start by adding some small functionality I want, hopefully if I feel the code I'll produce will be good enough and the functionality is acceptable I'll be able to contribute it, basically I want an option to symlink the book instead of copying (as the directory structure isn't to the choice of the user, and I already like mine with no space for double copies)

I just spend 3 hours trying to navigate the code but apparently my python skills are quite bad - I tried to follow calibre.gui2.add and gui2.actions.add but couldn't really find where the copy is being done. After some greping my current guess is in calibre.db.backend (copy_format_to?) but I'm entirely not sure. If someone can point me to the right direction I'd appreciate it. If that someone just so happens remembers vaguely the function call leading up to from the 'add' action that I'd appreciate it even more, as I want to add it as a proper config option and all (but I understand if it's too much to ask, it's like 50% of actually writing the patch I'll probably manage without it).
sthuck is offline   Reply With Quote
Old 11-02-2014, 04:04 AM   #2
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,742
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
IIRC and depending on how the book is added, the source file is opened in db.cache.add_format or in gui2.add.DBAdder.add_formats. The function db.backend.add_format takes an open file stream and writes it to the calibre library using info passed in other parameters.

There are lots of ways of adding books, such as copy from a device, by drag-and-drop, by copy-to-library, recursive walks, auto-add, etc. There is also a difference between adding a book and adding a format to an existing book.
chaley is offline   Reply With Quote
Advert
Old 11-02-2014, 10:11 AM   #3
sthuck
Junior Member
sthuck began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Nov 2014
Device: none
thanks a lot chaley!
sthuck is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
No choice of duplicates when copying one library to another BeeTee-Ess Calibre 5 01-12-2013 08:56 PM
Duplicates detection when copying library Giuseppe Chillem Calibre 1 01-07-2013 11:02 PM
Copying library phantom_cyclist Library Management 2 11-02-2012 06:13 AM
Copying Books from 1 Library to Another -- HELP BNGA Library Management 4 08-24-2012 09:26 AM
Copying/Transfering from Reader to Library on new PC sunsetsylvia Sony Reader 3 04-20-2009 11:57 AM


All times are GMT -4. The time now is 04:20 AM.


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