From 3f1924271606d729145d2274352c1842119c6d49 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Mon, 7 Oct 2024 15:10:55 +0300 Subject: [PATCH] sql: handle file symlinks --- papis_zotero/sql.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/papis_zotero/sql.py b/papis_zotero/sql.py index c1ffb97..0c9c427 100644 --- a/papis_zotero/sql.py +++ b/papis_zotero/sql.py @@ -140,6 +140,9 @@ def get_files(connection: sqlite3.Connection, item_id: str, item_key: str, if match := re.match("storage:(.*)", path): file_name = match.group(1) files.append(os.path.join(input_path, "storage", key, file_name)) + elif os.path.exists(path): + # NOTE: this is likely a symlink to some other on-disk location + files.append(path) else: logger.error("Failed to export attachment %s (with type %s) from path '%s'", key, mime_type, path)