feat: Add utility for finding duplicate Notion pages #433
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
To find duplicates based on a different database property, pass the property name to the
findDuplicates
function. For example, to find duplicates with the sameZotero URI
, use the following code.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