Skip to content

Commit

Permalink
fix(tests/sql): Pass the folder name pattern to papis run
Browse files Browse the repository at this point in the history
  • Loading branch information
kiike committed Mar 6, 2024
1 parent e549fee commit 232aabe
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions papis_zotero/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ def get_files(connection: sqlite3.Connection, item_id: str, item_key: str,
file_name = match.group(1)
files.append(os.path.join(input_path, "storage", key, file_name))
else:
logger.error("Failed to export attachment with type (%s) and key '%s' from path '%s'",
mime_type, key, path)
logger.error("Failed to export attachment %s (with type %s) from path '%s'",
key, mime_type, path)

return files

Expand Down Expand Up @@ -280,7 +280,9 @@ def add_from_sql(input_path: str, out_folder: Optional[str] = None,
logger.info("[%4d/%-4d] Exporting item '%s' to library '%s'.",
i, items_count, item_key, out_folder)

papis.commands.add.run(paths=files, data=item, link=link)
papis.commands.add.run(paths=files, data=item, link=link,
folder_name=papis.config.getstring("add-folder-name")
)

logger.info("Finished exporting from '%s'.", input_path)
logger.info("Exported files can be found at '%s'.", out_folder)

0 comments on commit 232aabe

Please sign in to comment.