Quote:
Originally Posted by kovidgoyal
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>>
|
Hmmmm.... My code lives in db/backend.py, specifically in the method construct_path_name().
Code:
print("db/backend.py: self: '%s'" % (self))
print("db/backend.py: metadata: '%s'" % (self.get_metadata))
gives
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'
Am I still allowed to "from calibre.library import db;" in construct_path_name() or would I somehow break caching?