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

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

Notices

Reply
 
Thread Tools Search this Thread
Old 05-03-2012, 09:32 AM   #1
schizoiddonkey
Member
schizoiddonkey began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Nov 2010
Device: kindle
Folder "device" plugin - suggestions?

Hi, was wondering if somebody who knows their way around Calibre could give me some hints. I've looked at some of the documentation, but Calibre is quite a large project so it's hard to say exactly how things will work without quite a bit of study.

What I'm aiming for is pretty simple: Have a folder interpreted as a device, much like the built-in "connect to folder" functionality except there will be a metadata file in the directory that I'll have to update when a book is added or deleted.

I'd like calibre to detect the directory itself, but ulitmately if the user has to "connect to folder" and calibre just recognises the metadata file itself then that'd be fine.

Thoughts? I've been looking at the DevicePlugin class but it seems to be heavily geared towards USB. Really I'm just looking for somebody to list ideas or places to me so that I can investigate them.

Thanks.
schizoiddonkey is offline   Reply With Quote
Old 05-03-2012, 10:03 AM   #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: 25,940
Karma: 5036099
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Simply modify the folder device plugin and re-implement the appropriate methods (look in devices.interface for the list of methods)
kovidgoyal is online now   Reply With Quote
 
Enthusiast
Old 05-03-2012, 10:13 AM   #3
schizoiddonkey
Member
schizoiddonkey began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Nov 2010
Device: kindle
Thanks Kovid, I'll check it out.
schizoiddonkey is offline   Reply With Quote
Old 05-03-2012, 11:21 AM   #4
chaley
"chaley", not "charley"
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: 5,444
Karma: 831552
Join Date: Jan 2010
Location: France
Device: Many android devices
How does the content of the metadata file you wish to update differ from the existing .metadata.calibre file? That file contains calibre metadata for books in the folder, and is maintained by the existing driver.

If it is a difference in format, then wouldn't a converter be easier to write?

Edit: If you really want to maintain a second metadata file, then you would add an override of sync_booklists. Write your metadata file, then call the method in the superclass (USBMS).

Last edited by chaley; 05-03-2012 at 11:26 AM.
chaley is offline   Reply With Quote
Old 05-03-2012, 12:20 PM   #5
schizoiddonkey
Member
schizoiddonkey began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Nov 2010
Device: kindle
Quote:
Originally Posted by chaley View Post
How does the content of the metadata file you wish to update differ from the existing .metadata.calibre file? That file contains calibre metadata for books in the folder, and is maintained by the existing driver.

If it is a difference in format, then wouldn't a converter be easier to write?
Format, yeah, probably less information too. Converter-wise, the file exists so it'd either have to be a two way conversion or I could just not care about what's in the calibre file. Either way I'd want this to be automatic as the whole point of this plugin is convenience (there are other ways of getting the book into the directory and updating the metadata file). However, there's likely to be other changes too (where to put thumbnails, directory structure etc), so a device plugin is probably the way to go.

Quote:
Edit: If you really want to maintain a second metadata file, then you would add an override of sync_booklists. Write your metadata file, then call the method in the superclass (USBMS).
Nice one, I'll look into that.

I do appreciate the answers. I think I have enough to get me going.
schizoiddonkey 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
SONY pocket edition: "Device locked" + "charge battery" obstacles? hermes Devices 3 06-02-2011 03:32 AM
No data in "In Library" and "On Device" columns after upgrade ily426 Library Management 8 04-03-2011 02:53 PM
Run plugin after "send to device" minicheck Development 1 02-26-2011 09:42 PM
automatically mount "folder device" perler Calibre 0 07-20-2010 04:28 PM


All times are GMT -4. The time now is 12:17 PM.


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