Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 04-26-2011, 08:54 AM   #1
gribbli
Junior Member
gribbli began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Apr 2011
Device: Kindle 3
Calibre file name resolution

Hi guys,

I have been using Calibre ever since I got the Kindle 3 at launch and with some rare free time on my hands I decided to use the pair as the basis for some other technologies I am experimenting with.

So yesterday I knocked together a quick web app for use on the kindle browser, which allows me to view and search my calibre book collection and select books to have emailed to the the device.

All works pretty well, my only concern is resolving the filename in order to ensure successful sending of the book. At the moment I am using a join of the books and data table in from the sqlite db, where path/name is exact but the file format column is uppercase. I am running on linux:mint so case sensitivity is a potential issue. So my question is, is there anywhere that holds the full filename+exact extension that I have overlooked, or even just more reliable data for ensuring the matching?

@Mods: If I have posted this in the wrong place by all means kick me in the right direction.

Cheers,
gribbli
gribbli is offline   Reply With Quote
Old 04-27-2011, 01:26 PM   #2
Starson17
Wizard
Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.Starson17 can program the VCR without an owner's manual.
 
Posts: 4,004
Karma: 177841
Join Date: Dec 2009
Device: WinMo: IPAQ; Android: HTC HD2, Archos 7o; Java:Gravity T
Quote:
Originally Posted by gribbli View Post
I am using a join of the books and data table in from the sqlite db, where path/name is exact but the file format column is uppercase. I am running on linux:mint so case sensitivity is a potential issue. So my question is, is there anywhere that holds the full filename+exact extension that I have overlooked, or even just more reliable data for ensuring the matching?
AFAIK, the extension is stored upper case in the database list and is always lower case as part of the filename. If you're worried, take a look at calibre.gui2.actions.copy_to_library and see:
Spoiler:
Code:
    def doit(self):
        from calibre.library.database2 import LibraryDatabase2
        newdb = LibraryDatabase2(self.loc)
        for i, x in enumerate(self.ids):
            mi = self.db.get_metadata(x, index_is_id=True, get_cover=True)
            self.progress(i, mi.title)
            fmts = self.db.formats(x, index_is_id=True)
            if not fmts: fmts = []
            else: fmts = fmts.split(',')
            paths = [self.db.format_abspath(x, fmt, index_is_id=True) for fmt in
                    fmts]
            print 'paths are: ', paths


The paths of format_abspath in the print statement I added at the end are the fully qualified path/filenames including extensions.
Starson17 is offline   Reply With Quote
Advert
Old 04-27-2011, 01:30 PM   #3
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: 43,842
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
the full path is not stored anywhere you have to compose it from the format and name fields of the data table and the path field of the books table. And always lowercase the format.
kovidgoyal is online now   Reply With Quote
Old 04-28-2011, 09:38 AM   #4
gribbli
Junior Member
gribbli began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Apr 2011
Device: Kindle 3
Thanks for the info guys, I had to add a lower() conversion on the extension to get it working in the first place so it sounds like I have already got it covered. With that part working, next job is to see if I can add to the Calibre library using the Kindle
gribbli is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
File Replacement outside of Calibre Zipr Calibre 1 02-13-2011 06:34 PM
Calibre debug file meme Calibre 7 02-01-2011 04:45 PM
Calibre File Names ll Legion ll Calibre 4 10-13-2010 05:03 PM
calibre 0.6.17 can't convert any file Phil_C Calibre 9 10-11-2009 09:02 PM
File Names in Calibre jimbo Calibre 6 07-19-2008 09:21 PM


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


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