From 4c6bcf512f988a39a28f8ba5345dacc849967711 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 14 Sep 2009 17:34:28 -0600 Subject: [PATCH] Implement #2575 (Optional config option to specify alternate location of metadata.db) --- src/calibre/library/database2.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/calibre/library/database2.py b/src/calibre/library/database2.py index 79737f4f57..d7adcd7fee 100644 --- a/src/calibre/library/database2.py +++ b/src/calibre/library/database2.py @@ -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()