aaFn / Bookmark-search-plus-2

Displays and filters bookmarks on search string, show parent folders. This is a Web Extension add-on version of the old "Bookmark search plus" XUL extension published by Alice0775, not working anymore in latest Firefox, and which was very useful.
117 stars 11 forks source link

Duplicated Bookmarks - now have 'Menu' and 'Bookmarks Menu' folders #292

Closed porkyfork closed 9 months ago

porkyfork commented 10 months ago

Hi, Been using BSP2 for a while now, invaluable tool !

Recently I have noticed - when searching for a folder name, duplicate folder names appearing in the results under 'Search Bookmarks'.

Upon investigating it appears a new folder has appeared called Menu, (nested inside 'Bookmarks Menu') and in this new folder is a duplicate set of all the bookmarks that were available at what ever time this 'Menu' folder was created.

Unbeknownst to me, I have been adding new bookmarks - but to the new 'Menu' set of book marks, instead of the 'Bookmarks Menu'.

I have no idea how this happened.

Is there an easy way to resolve this, and how did I end up with a duplicate set of bookmarks.

Some screen shots, I have erased the other bookmarks for simplicity of viewing;

Capture

Capture 2

aaFn commented 10 months ago

Hello @porkyfork , strange indeed. "menu" is not a word or folder that BSP2 uses specifically, and this is not something that Firefox does on its own either to my knowledge, so it was either created by another add-on or by you accidentally.

One thought: open the BSP2 Bookmark history (click on the magnifying glass to get the menu for it), and check if you can see when "menu" was created, if it was a copy or something else ..

To resolve the situation depends on what you think is the most recent. If you believe what is in menu is the most recent, then, I would propose the following:

  1. backup your bookmarks using the Firefox menu or the bookmarks library, to make sure you can come back to it
  2. by security, make sure that the BSP2 trash is enabled in BSP2 options
  3. also, just in case that there is something odd in the context, in the BSP2 options, press "Reload all from FF API now"
  4. by excess of security, also export your bookmarks to an HTML file, but this should not be needed
  5. then multi-select all folders in "Bookmarks Menu", except "menu" and press Delete (or right click and delete)
    • this will in fact move them to the BSP2 trash
  6. then open the "menu" folder,
    • right-click on it, and do a "Collapse all"
    • multi-select all its content
    • move (drag & drop, or copy / paste) all that selected content under "Bookmarks Menu"
  7. Delete the now empty "menu"

That should solve the problem, and also you can play with undo/redo in case this is not going like you want. Worst case, you can restore your previous state, and redo it differently.

Note that the same proc with only steps 1, and 4 to 7, can also be executed in the native FF bookmark sidebar, except the "Collapse all" step that you will have to do by hand.

Let me know, aaFn.

porkyfork commented 10 months ago

Hi @aaFn

Thanks for the swift reply.

Before I move and delete anything, is there anyway to compare the content of the 'Bookmarks Menu' Folder with the 'Menu' folder, I have 11,400 book marks, and to complicate matters I may have added new bookmarks to either set, with so many bookmarks its difficult to tell. Is there a way to split out the 2 Menu's I have into separate files, and then something like Winmerge be used to identify whats different between each.

Can I ask about 'Reload all from FF API now"', is the setting for that:

image

One last issue, I have a bookmark I cannot delete, and that has no icon, in the BSP2 folder list this bookmark is in the root (ie not in any folder) of the 'Menu' list, but not in the 'Bookmarks Menu' list, none of the other folders that should be visible after it (alphabetically) are visible in BSP2, although they are in the FF Drop Bookmarks list. ... it acted funny when it was added - caused odd indents - couldn't delete it etc. Will this get sorted when I check 'Reload all from FF API now'. ? or is there something else I need to do.

Thanks

aaFn commented 10 months ago

Checking that option is not meaningful in your case, and I should probably remove it now, that was a security at an early stage.

You just need to press the button once to reload one time. Its role is to make sure that the BSP2 cache of bookmarks is aligned to the "source of truth" which is Firefox, and yes, it could solve the bookmark with no icon problem. If that doesn't solve it, could you post here a picture of it, and of its properties, and also a picture of the FF native sidebar showing it and its sibblings ?

I do not know of an easy way to compare and/or to merge two bookmark lists, search for that on the internet, you will find some procs using Python script, but nothing direct nor quick easy as I could see so far.

But you can look at the BSP2 history to retrieve what you did, and pinpoint where are new things you did since "menu" was created, provided this creation was less than 30 days ago if you didn't modify the default duration (you might want to modify it now to be on the safe side and avoid history trimming).

porkyfork commented 10 months ago

Thanks for your advice. Have taken some tmie to read more thoroughly the details on this Add-0n, you have created a great tool, thanks.

I have 'reloaded' and the phantom bookmark has disappeared.

Sadly I cannot see in the history when this 'Menu' folder was created, and I have the setting to 60 days, but I suspect I have not noticed this new 'Menu' folder for a while.

Your actions 5, 6 and 7 above - I presume this simply deletes one set of bookmarks, however I have been adding bookmarks to both sets unwittingly ovet the last few months, and need to combine them, I suspect this will need to be a manual process.

I am able to use the magnifier menu 'open BSP2 in a tab' to open two windows side by side- what would be really helpful is to see how many bookmarks and subfolders are in each folder as I work down, that would hekp identify differences, and allow me to go to the 'Menu' folder bookmarks that need moving to the 'Bookmarks Menu' folder.

In FF's Manage Bookmarks 'Library' page - one can search for '.' then select all found (bookmarks), it then displays a figure for the likely total of bookmarks (items), however you cannot search within a folder, which is a shame, unless i am missing a command to allow it to do that.

I note: https://kb.mozillazine.org/Counts_-_Counting_bookmarks_history_links_and_other_data_-_Firefox

Can you search within a folder or sub folder in BSP2 to find the number of 'items' within it ?

I note you can search using Regex, would i be able to see the number of 'items' in folders using this.

Ideally something that simply displayed the number of items in a folder to the right of each folder, as say you could once do with Thunderbird extensions, would make life easier.

porkyfork commented 9 months ago

Its solved.

I used this Firefox extension to simply help weed out Dupes: Bookmark Dupes: https://addons.mozilla.org/en-US/firefox/addon/bookmark-dupes/

Has excellent facility to isolate what is unique or a dupe in any folder, and then mark them, and delete them - I used 'open BSP2 in a tab' to open bookmarks (without the sidebar width limitation) in a new window, twice - so I could view the folder heirachy for 'Bookmarks Menu' and 'Menu' - and had the Bookmarks Dupe search results beneath that, and simply dragged bookmarks that were displayed between windows, checking as I went using the Bookmark search - when all was good I simply binned the 'Menu' folder.

Previously I had looked at using regex within BSPs seach with certain long drawn out functiosns, which I couldn't get to work - but Bookmark Dupes did all I needed it to.

Thanks

aaFn commented 9 months ago

Hello @porkyfork , great that you found a way, this extension looks quite useful indeed. And if all is well, you should have a trace of all your operations in the BSP2 history, and a way to undo/redo if needed for the next 60 days, so you have time to recover / or find out if something went wrong.

Thank you for the pointer, aaFn.