10-02-2013, 05:02 PM | #1 |
Zealot
Posts: 136
Karma: 60
Join Date: Jul 2009
Location: Munich, Germany
Device: Nook Classic rooted; Galaxy S IV with Aldiko, other older devices
|
Accessing Series and Metadata with the "new api"
I used to (at least with the 0.9 tree) be able to access metadata and series information for a book with "self.metadata" and "self.series".
With the switch to db/backend.py, I can't find those methods anymore: Code:
calibre, version 1.5.0 ... ERROR: Unhandled exception: <b>AttributeError</b>:'DB' object has no attribute 'series' |
10-02-2013, 10:03 PM | #2 |
creator of calibre
Posts: 43,866
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Those functions still exist, though note that it is get_metadata.
Code:
calibre-debug -c "from calibre.library import db; db = db(); print db.series, db.get_metadata" <bound method LibraryDatabase.func of <calibre.db.legacy.LibraryDatabase object at 0x7f856b61fc10>> <bound method LibraryDatabase.get_metadata of <calibre.db.legacy.LibraryDatabase object at 0x7f856b61fc10>> |
10-03-2013, 04:22 AM | #3 | |
Zealot
Posts: 136
Karma: 60
Join Date: Jul 2009
Location: Munich, Germany
Device: Nook Classic rooted; Galaxy S IV with Aldiko, other older devices
|
Quote:
Code:
print("db/backend.py: self: '%s'" % (self)) print("db/backend.py: metadata: '%s'" % (self.get_metadata)) Code:
db/backend.py: self: '<calibre.db.backend.DB object at 0x056FD350>' ... File "H:\src\calibre\calibre-github\src\calibre\db\backend.py", line 1099, in construct_path_name AttributeError: 'DB' object has no attribute 'get_metadata' |
|
10-03-2013, 04:57 AM | #4 |
creator of calibre
Posts: 43,866
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
At that level there is no access to other metadata. If you want to change how paths are created you will need to change update_path() in db/cache.py in addition to changing construct_path_name and construct_file_name
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Alter Double-click behaviour to "edit metadata" instead of "open ebook?" | Feather_Qwill | Library Management | 5 | 09-15-2013 11:20 AM |
Modification of Metadata recipe "Put series into the title, using either initials .." | Riva3000 | Library Management | 0 | 05-08-2013 04:33 PM |
Issue Editing MetaData in "Series" Field | slammerkin | Library Management | 4 | 12-09-2012 01:33 AM |
Plugboard "Metadata: Show series [series index] - title as title (Kindle)" | Deep Cover | Library Management | 6 | 11-30-2012 05:17 PM |
PRS-T1 Sony "Collections" vs Calibre "Series" | ted13b | Sony Reader | 3 | 02-20-2012 09:46 AM |