Skip to content

Commit

Permalink
sql: handle file symlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfikl committed Oct 8, 2024
1 parent 738a42b commit 3f19242
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions papis_zotero/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3f19242

Please sign in to comment.