Skip to content

ChenglongMa/zoplicate

Repository files navigation

zoplicate banner

πŸ‘‰ zotero target version Version for Zotero 7 Downloads for Zotero 7πŸ‘ˆ πŸ‘‰zotero target version Version for Zotero 6 Downloads for Zotero 6πŸ‘ˆ

GitHub License Using Zotero Plugin Template Discord GitHub Repo stars


A plugin that does one thing only: Detect and Manage duplicate items in zotero.

Main Features

  • Duplicates Detection
    • Detects if newly imported items are duplicates of existing ones in the Zotero library.
    • You can:
      1. Keep This: Save the last imported item and delete the rest.
      2. Keep Others: Delete the last imported item and save the rest.
      3. Keep All: Keep both the new item and the existing item.
      4. Merge Manually: Go to the Duplicate Panel and merge the duplicate item manually.
  • Auto-Bulk Merge
    • Merges all duplicate items in the library automatically.
    • Introduced in Version 2.0.0.
  • Non-duplicates Management
    • Allows marking items as "Non-duplicates" if mistakenly identified as duplicates by Zotero.
    • Introduced in Version 3.0.0.

If you find this project helpful, please consider giving it a star ⭐. It would be a great encouragement for me!

Note

We use the same method as Zotero to detect and merge duplicate items.

See Zotero Documentation - Duplicate Detection for more details.

Changelog

v3.0.1

Click here to show more.

In this version, we have made the following changes:

  1. 🧬 CHANGE!: We have updated the UI of buttons in the duplicate pane.
  2. πŸ› FIX!: We have optimized the performance of duplicate search and detection.

v3.0.0

Click here to show more.

In this version, we have made the following changes:

  1. πŸ› FIX!: We have fixed a memory leak bug that caused the app to freeze when editing PDF annotations.
  2. ✨ NEW!: We have added the Non-duplicates functionality.
    • You can mark items as Non-duplicates when they are mistakenly identified as "duplicates" by Zotero.
    • Selecting two "false duplicates", you can find the They are NOT duplicates menu items in the context menu.
      • menu_not_duplicates
    • You can also find the They are NOT duplicates button in the Duplicate Items panel.
      • button_not_duplicates
    • For more details, please see Non-duplicates section below.
    • Thanks dschaehi for the discussion in issue #25.

v2.3.0

Click here to show more.

In this version, we have made the following changes:

  1. ✨ NEW!: We have added an option to show the duplicate count on the left collection pane.
    • You can find the option in the Zoplicate tab in the settings.

    • When your mouse hovers over the Duplicate Items entry, a tooltip will show the duplicate statistics.

      Show duplicate count

    • The duplicate count will be updated automatically. You can also find the Refresh Duplicate Count menu to update the count manually.

      Refresh duplicate count

    • Thanks Apollo7777777's idea mentioned in discussion #18

  2. πŸ› FIX!: We have fixed a bug that caused the dialog to be too narrow when the title is short.
  3. πŸ› FIX!: We have fixed a bug that caused the Bulk Merge icons to not maintain aspect ratios.

v2.2.0

Click here to show more.

In this version, we have made the following changes:

  1. ✨ NEW!: We have added "Smart" Merge functionality (Only available in Zotero 7 now).
    • When merging duplicate items, the function will fill in the missing information of the retained item with the duplicates.
    • Thanks endfreude's idea mentioned in issue #15.

v2.1.0

Click here to show more.

In this version, we have made the following changes:

  1. ✨ NEW!: We have added the Suspend and Restore functionality (Only available in Zotero 7 now).
    • Please see Bulk Merge section below for more details.
  2. 🧬 CHANGE!: We have changed the behavior of Keep Others action.
    • Previously, the Keep Others action will delete the last imported item and save ALL the rest existing items.
    • Now, the action will Merge the existing items based on the Master Item preferences in Settings.
  3. πŸ› FIX!: We have fixed a bug that caused the tags could not be loaded correctly in v2.0.0.

v2.0.0

Click here to show more.

In this version, we have made the following changes:

  1. ✨ NEW!: We have added the Bulk Merge functionality (Only available in Zotero 7 now).
    • Bulk Merge: Merge all duplicate items in the library automatically.
    • You can find the Bulk Merge button in the Duplicate Items panel.
    • Please see Bulk Merge section below for more details.
    • Thanks csdaboluo's idea mentioned in issue #8.
  2. πŸ› FIX!: We have fixed a bug that caused the dialog height to be too high when importing duplicate items in bulk.
  3. πŸ› FIX!: Now Zotero will auto-select the remained item after merging duplicate items.

v1.1.0

Click here to show more.

In this version, we have made the following changes:

  1. 🧬 CHANGE!: We have changed the processing method of duplicate items.

    Previously, we use the Trash method to process duplicate items, i.e., delete the duplicate items. However, this method will cause the loss of some information of the duplicate items.

    • E.g., notes, tags, collections, attachments.

    In this version, we use the Merge method to process duplicate items. This method will copy all the aforementioned information to the retained item, and then delete the duplicate items.

    • NOTE: If you are using ZotFile, the Merge method will copy the file link of the duplicate items to the retained item.
    • However, users relying on Zotero's default attachment storage may encounter duplication issues if the newly imported item contains attachments.

Thanks ChinJCheung's idea mentioned in issue #5.

Install

  1. Download .xpi file according to the version of Zotero you are using.
  2. Then, in Zotero, click Tools -> Add-ons and drag the .xpi onto the Add-ons window. See how to install a Zotero addon.

Usage

Settings

In Zotero, click Edit -> Settings, go to Zoplicate tab, and you will see the settings.

zoplicate settings

  1. You can select the actions you want to take when duplicate items are detected.
    • Always Ask is the default option if you have not changed the settings.
  2. You can select the version of duplicate items to use as the master item.
    • Earliest Added is the default option if you have not changed the settings.

Duplicate Detection

By default, or you have selected Always Ask in the settings, a dialog will pop up when you import a new item that is a duplicate of an existing item.

zoplicate dialog

The dialog will show the duplicate items and the actions you can take.

  1. Select the action you want to take and click Apply to process the duplicate items.
  2. Click Go to Duplicates to go to the Duplicate Items panel and merge the duplicate items manually.
  3. Click Cancel to dismiss the dialog and save the import of the new item and the existing items.
  4. Check Use this action by default to remember the selected action in default settings. Then the next time you import a duplicate item, the selected action will be applied automatically.

Multiple Duplicate Items

When you import multiple duplicate items, or import another duplicate item before you process the previous duplicate items, the dialog will show all the duplicate items and the actions you can take.

zoplicate dialog

  1. You can select different actions for different duplicate items.
  2. Click the header of action columns to select the same action for all duplicate items.
  3. Use this action by default option will be shown only when you select the same action for all duplicate items.

Bulk Merge

Inspired by csdaboluo's idea and ZoteroDuplicatesMerger, we have added the Bulk Merge functionality in Version 2.0.0.

In the Duplicate Items panel, you can find the Bulk Merge button:

zoplicate bulk merge

You can also find it when you select one or more duplicate items:

zoplicate bulk merge

Warning

  1. Before clicking the button, please make sure you have properly configured the Master Item preferences in Settings.
  2. The Bulk Merge functionality will take a while to complete if you have a large number of duplicate items.
  3. This functionality is only available in Zotero 7 now. I will check compatibility and try to migrate to Zotero 6.

You will see the progress of the bulk merge process: zoplicate bulk merge process

Suspend Bulk Merge

You can click the Suspend button to suspend the bulk merge process.

A dialog will pop up to confirm your action: zoplicate bulk merge suspend

  1. Click Resume to resume the bulk merge process.
  2. Click Cancel to cancel the bulk merge process.
    • Check Restore Deleted Items to restore the duplicate items that have been merged.
    • Note that the Restore action is only effective if you click Cancel.

Tip

If you want to Restore the duplicate items that have been merged, you can go to Trash panel and restore them.

  1. Select the duplicate items you want to restore.
  2. Click Restore to Library button to process.

Show Duplicate Statistics

Starting from Version 2.3.0, we have added an option to show the duplicate count on the left collection pane.

You can find the option in the Zoplicate tab in the settings.

When your mouse hovers over the Duplicate Items entry, a tooltip will show the duplicate statistics.

Show duplicate count

The duplicate count will be updated automatically. You can also find the Refresh Duplicate Count menu to update the count manually.

Refresh duplicate count

Non-duplicates

Starting from Version 3.0.0, we have added the Non-duplicates functionality.

You can mark items as Non-duplicates when they are mistakenly identified as "duplicates" by Zotero.

Selecting an item, you can manage the Non-duplicates items in the side panel: side_panel_not_duplicates

  • Click the non-duplicate button button to show the Non-duplicates section.
  • Click the + button to add the selected item to the Non-duplicates list.
  • Click the - button to remove the selected entry from the Non-duplicates list.

There are some ways to mark and unmark items as Non-duplicates:

Mark as Non-duplicates

  1. Click the + button to add the selected item to the Non-duplicates list.
  2. Selecting two "false duplicates", you can find the They are NOT duplicates menu items in the context menu.
    • menu_not_duplicates
  3. You can also find the They are NOT duplicates button in the Duplicate Items panel.
    • button_not_duplicates

Unmark as Non-duplicates

  1. Click the - button to remove the selected entry from the Non-duplicates list.
  2. Selecting two "non duplicates", you can find the They are duplicates menu items in the context menu.
    • menu_not_duplicates

Contributing

πŸ‘‹ Welcome to Zoplicate! We're excited to have your contributions. Here's how you can get involved:

  1. πŸ’‘ Discuss New Ideas: Have a creative idea or suggestion? Start a discussion in the Discussions tab to share your thoughts and gather feedback from the community.

  2. ❓ Ask Questions: Got questions or need clarification on something in the repository? Feel free to open an Issue labeled as a "question" or participate in Discussions.

  3. πŸ› Issue a Bug: If you've identified a bug or an issue with the code, please open a new Issue with a clear description of the problem, steps to reproduce it, and your environment details.

  4. ✨ Introduce New Features: Want to add a new feature or enhancement to the project? Fork the repository, create a new branch, and submit a Pull Request with your changes. Make sure to follow our contribution guidelines.

  5. πŸ’– Funding: If you'd like to financially support the project, you can do so by sponsoring the repository on GitHub. Your contributions help us maintain and improve the project.

Thank you for considering contributing to Zoplicate. We value your input and look forward to collaborating with you!