Implement #2575 (Optional config option to specify alternate location of metadata.db)

This commit is contained in:
Kovid Goyal 2009-09-14 17:34:28 -06:00
parent 22a2420450
commit 4c6bcf512f

View File

@ -413,6 +413,8 @@ class LibraryDatabase2(LibraryDatabase):
self.library_path = os.path.abspath(library_path)
self.row_factory = row_factory
self.dbpath = os.path.join(library_path, 'metadata.db')
self.dbpath = os.environ.get('CALIBRE_OVERRIDE_DATABASE_PATH',
self.dbpath)
if isinstance(self.dbpath, unicode):
self.dbpath = self.dbpath.encode(filesystem_encoding)
self.connect()