papis / papis-zotero

Zotero compatibility layer for papis
GNU General Public License v3.0
75 stars 17 forks source link

sql: Multiple calls import the same items again #36

Closed alexfikl closed 8 months ago

alexfikl commented 1 year ago

From #33

Importing already "imported" items.

I find it unintuitive that if you are running the import again, and you already have those items as folders/files on your system and they are probably being written over there is no "WARNIG" or "CHOICE" about this. I'm not sure what to recommend. Maybe something like

[INFO] Trying to export item XYZ (a nice  first neutral message)
[WARNING] Item XYZ already in the papis folder foo/bar. 
[INFO] Skipped trying to import item XYZ. Use --force to rewrite those folders/files
[INFO] Trying to export item XYZ (a nice  first neutral message)

and when using that "force",

[INFO] Trying to export item XYZ (a nice  first neutral message)
[WARNING] Item XYZ already in the papis folder foo/bar. 
[INFO] Force option used. folder/fileXYZ overwritten
[INFO] Sucessfuly imported item XYZ.
[INFO] Trying to export item XYZ (a nice  first neutral message)
kiike commented 8 months ago

This problem is now fixed with the recent commits in #43: the papis API is now taking care of adding, and asking for confirmation on adding duplicated files. The flags --no-confirm and --confirm should provide/avoid interaction on such cases.

alexfikl commented 8 months ago

Agreed! Thanks for working on that :grin: