Recursive search via Tags?

Hello,

I am thinking about a easy way to exclude (or include) certain folders from the scanner of the new audio-player app.

“Music” goes that way, that in the usersettings, the searchfolders need to be defined.
I thought about scanning everything - unless there is a positive or negative Tag/Category set to keep it simpler for the user.

But when looking at searchByMime or searchByTag, they are only straight forward.
One way could be to use both of them combined with a getSubFolders and build a recursive construction of the filelist to be scanned.

is there anything else which could be used for this?

Hi @z000ao8q,

There was a discussion thread about this (https://help.nextcloud.com/t/use-the-search-bar-to-search-for-files-by-tag/1404 ), along with a feature request to improve overall search functionality. https://github.com/nextcloud/server/issues/326 Feel free to join the conversation :slight_smile:

Cheers,
TC

searchByTag is only for favorites as of now, iirc.
That is not related to the system tags we introduced in 9

when i leave a comment it leaves an entry in oc_comments with the fields message, object_id.

a possible “include” or “exclude” way would be to:

  • get all IDs with searchByMime
  • get include/exclude object_IDs from comments-table
  • recursively search all object_ids underneath this comment
  • compare the array

any other more elegant suggestion?

I think this “can be” approach is simpler compared to strict user settings.

Just a word of warning. That’s how “Pictures” used to work and people started to complain that it took forever to load the app.
You don’t have much of a choice if you want to offer the full collection on the landing page, but make sure you:

  1. don’t make it the default
  2. add a clear warning about what it means to scan the whole storage locations

Thank you for that!
The app always accesses its internal tables

This tagging would only apply when the user re-/scanns the library manually.
So it should only have limited impact

From NC 10 you can use background jobs, which should help a lot building your internal tables and if you setup hooks, then you should be able to keep them in sync with the real storage.

Good

Also an occ capability is on the tasklist

You may find this useful:

You would add the files to your DB instead of generating previews.

1 Like