View Single Post
Old 09-16-2008, 03:50 AM   #4
pepak
Guru
pepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura aboutpepak has a spectacular aura about
 
Posts: 610
Karma: 4150
Join Date: Mar 2008
Device: Sony Reader PRS-T3, Kobo Libra H2O
The collections are defined by an external file which looks something like this:

Code:
MemoryType=int
Recursive=1
FileNameRegExp=\.(lrf|pdf|txt|rtf|epub)$
Cache=database\cache\media.xml
BooksPath=database\media\books\
BooksBasePath=database/media/books/

[Collection of Something]
something\book1.pdf
something\book2.lrf
something\book3.lrf

[My Favorite Books]
something\book1.pdf
foo\bar.txt
cool.rtf
It could be modified to work directly with directory structure via regexps, probably easily enough. At the moment it seemed more useful to go for a list-based approach, as it allows placing a book into several collections and ordering the collection correctly.

Windows-specific stuff - there is a CreateProcess call to execute Calibre's whatever-META.EXE and capture its output, but I am sure that could be easily rewritten for Linux. The biggest obstacle will be the XML library I used - it seemed like a lot of work just to make it compile under FreePascal.

Last edited by pepak; 09-16-2008 at 03:52 AM.
pepak is offline   Reply With Quote