Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More Options for Handling Duplicates #40

Open
heymaad opened this issue Aug 23, 2024 · 14 comments
Open

More Options for Handling Duplicates #40

heymaad opened this issue Aug 23, 2024 · 14 comments

Comments

@heymaad
Copy link

heymaad commented Aug 23, 2024

Currently, it creates a new pdf with -1 at the end. Would it be possible to have more customization, where:

  1. It would create a new file with " - 1" at the end as it does now
  2. Do not copy the file if it already exists
  3. Overwrite the previous copy, and show an error if overwrite fails

Please let me know if this sounds like a good feature to implement :)

@wileyyugioh
Copy link
Owner

It's definitely a possibility. Can you explain why specifically you want features 2 and 3?

The reason duplicates are handled the way they are now is to prevent files from accidentally being deleted when moved. For example Item A and Item B have pdfs that share the same filename, but contain different content. In the case of 2, Item B cannot be moved unless the filename is manually changed, and in the case of 3 Item A will be pointing to the wrong file.

@danielvartan
Copy link

I think @heymaad is referring to a duplicate behavior in zotmoov when attaching files from the source folder. Specifically, when attaching a file in Zotero using the menu option Zotmoov: Attach New File, the extension attaches two identical files to the reference.

This is really annoying. It makes the whole effort meaningless.

@danielvartan
Copy link

danielvartan commented Aug 26, 2024

@wileyyugioh
Copy link
Owner

wileyyugioh commented Aug 27, 2024

Oh wow. That is definitely a bug. What version of ZotMoov are you running? In the latest version (1.1.8) I made it so files are instantly linked when using the add menu option.

Also, the linked files are only deleted when you empty the trash.

@danielvartan
Copy link

I'm using the most recent version (1.1.8).

Oh wow. That is definitely a bug. What version of ZotMoov are you running? In the latest version (1.1.8) I made it so files are instantly linked when using the add menu option.

Also, the linked files are only deleted when you empty the trash.

@wileyyugioh
Copy link
Owner

Try 1.1.9. I think I identified the bug (a race condition between adding the file and the auto functionality).

@danielvartan
Copy link

Try 1.1.9. I think I identified the bug (a race condition between adding the file and the auto functionality).

It's working fine now! Thank you for all your hard work @wileyyugioh ! 🎉

@wileyyugioh
Copy link
Owner

wileyyugioh commented Aug 28, 2024

Can you please try the latest prerelease and see if the problem is also fixed in this version? I changed how the bug was fixed under the hood and want to make sure it still works.

@danielvartan
Copy link

Can you please try the latest prerelease and see if the problem is also fixed in this version? I changed how the bug was fixed under the hood and want to make sure it still works.

Work like a charm. :)

@danielvartan
Copy link

danielvartan commented Sep 12, 2024

Hi @wileyyugioh ,

I found the same duplicate behavior when attaching an EPUB to a reference.

EDIT: It's happening with PDFs too.

How to reproduce the error

  • Create a reference on Zotero 7.
  • Manually attach an EPUB to the reference by dragging the file to it using the mouse.

System Info

  • Windows 11 Home Single Language 23H2
  • Zotero 7.0.5 (64-bit)
  • ZotMoov 1.1.12

@wileyyugioh
Copy link
Owner

Is this happening when you drag-drop an item? So it's not an issue with the add button is that right?

@danielvartan
Copy link

Is this happening when you drag-drop an item? So it's not an issue with the add button is that right?

Yes. It's not an issue with the add button.

@wileyyugioh
Copy link
Owner

@danielvartan Can you try 1.1.14. I think I found a race condition in the drag-drop code.

@danielvartan
Copy link

Just tried with the 1.1.14, as you suggested. All good!

Thank you for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants