From fc228bd5b517acc48e18f18a4f171423ed3f0e64 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 6 Aug 2009 15:19:40 -0600 Subject: [PATCH] Fix #3091 (calibredb list doesn't honour --prefix completely anymore) --- src/calibre/library/database2.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/calibre/library/database2.py b/src/calibre/library/database2.py index 6e04f835b9..95c1731fcd 100644 --- a/src/calibre/library/database2.py +++ b/src/calibre/library/database2.py @@ -1525,6 +1525,9 @@ class LibraryDatabase2(LibraryDatabase): if formats: for fmt in formats.split(','): path = self.format_abspath(x['id'], fmt, index_is_id=True) + if prefix != self.library_path: + path = os.path.relpath(path, self.library_path) + path = os.path.join(prefix, path) x['formats'].append(path) x['fmt_'+fmt.lower()] = path x['available_formats'] = [i.upper() for i in formats.split(',')]