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

feat: Add utility for finding duplicate Notion pages #433

Merged
merged 8 commits into from
Jan 15, 2024
Merged

Conversation

dvanoni
Copy link
Owner

@dvanoni dvanoni commented Jan 15, 2024

Summary

Depending on the circumstances, Notero can sometimes end up creating duplicate Notion pages for a given Zotero item. To address this issue as requested in #252, this PR adds a utility function for finding duplicate pages based on a specific database property.

There is no UI created for this utility yet. This is a first iteration to test the efficacy of this approach based on user feedback.

Usage

The utility function can be called via the Run JavaScript window available from the menu: Tools → Developer → Run JavaScript.

Paste the following code into the window, ensure the "Run as async function" option is enabled, and click the Run button at the top left. This will return page titles that appear in the database multiple times.

return await Zotero.Notero.findDuplicates();

To find duplicates based on a different database property, pass the property name to the findDuplicates function. For example, to find duplicates with the same Zotero URI, use the following code.

return await Zotero.Notero.findDuplicates('Zotero URI');

You can then use the results to search for the duplicate pages in Notion.

Example

CleanShot.2024-01-14.at.23.23.26-converted.mp4

Copy link
Contributor

🤖 Build Bot

✅ Successful build

⬇️ Download: notero-0.5.8-343

@dvanoni dvanoni merged commit bd23e84 into main Jan 15, 2024
5 checks passed
@dvanoni dvanoni deleted the find-duplicates branch January 15, 2024 07:29
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

Successfully merging this pull request may close these issues.

1 participant