kaiiiz / obsidian-raindrop-highlights-plugin

An Obsidian.md plugin that syncs highlights from Raindrop.
MIT License
213 stars 11 forks source link

Have folders per nested collections without explicit selection #67

Open gauravkumar37 opened 11 months ago

gauravkumar37 commented 11 months ago

Hi, Thanks for the wonderful plugin.

I want to sync all bookmarks including all nested collections but I also want the same nested structure to be present folder-wise. For this, the only way to do is to select all the collections one by one in the Manage Collections button. This has 2 drawbacks:

  1. Manual selection is required. If we have 50 nested collections, this becomes a problem
  2. When a new nested collection is added in Raindrop, it won't be automatically selected in this plugin
  3. Since all the nested collections are selected one by one, this plugin syncs them one by one as well - this can result in very slow syncing and causes too many requests to Raindrop API which is not what we want.

I think the solution is simply to honor All bookmarks collection but have the file rename template work for folders as well. This will make it pretty generic, example: /{{collection.title}}/{{id}}

Thanks

kaiiiz commented 10 months ago

Thanks for the feedback!

However, I want to clarify some implementation details.

If you have a collection c2 nested in the collection c1, and collection c1 stores a bookmark b1 and collection c2 stores a bookmark b2. The API request for collection c1 only responses b1 instead of b1 and b2. Therefore, the nested structure must be synced separately.

To reduce unnecessary request, the lastUpdate information in rest/v1/collections and rest/v1/collections/childrens endpoint can be used, which may eliminates the problem 3 you pointed out.

As for problem 1 and 2, the plugin can automatically select the nested collection if a parent collection is selected when performing collection syncing. However, this breaks the current collection syncing behavior. Maybe adding a new option "Automatically select nested collections" is a proper implementation for this request.

gauravkumar37 commented 10 months ago

the nested structure must be synced separately

correct

the lastUpdate information in rest/v1/collections and rest/v1/collections/childrens endpoint can be used

yes, this should enable the fast syncing, but isn't that already been used?

Automatically select nested collections

yes, this would solve the problem. But this should also automatically select if a new nested collection becomes available under the nested collection so that it is also automatically selected

gregheth commented 10 months ago

+1