Rello
July 17, 2016, 5:50am
1
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
Cheers,
TC
searchByTag is only for favorites as of now, iirc.
That is not related to the system tags we introduced in 9
Rello
July 19, 2016, 12:57pm
4
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.
oparoz
July 21, 2016, 11:47am
5
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:
donāt make it the default
add a clear warning about what it means to scan the whole storage locations
Rello
July 21, 2016, 1:11pm
6
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
oparoz
July 21, 2016, 1:13pm
7
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.
Rello
July 21, 2016, 1:16pm
8
Good
Also an occ capability is on the tasklist
oparoz
July 21, 2016, 1:33pm
9
You may find this useful:
owncloud:master
ā owncloud:create-thumbnail-command
opened 06:08PM - 27 Sep 15 UTC
Sunday Funday!
Here are some command some of you may find useful to manage yourā¦ thumbnails:
## Create thumbnails
Solution for https://github.com/owncloud/core/issues/17536
### Documentation
[Create thumbnails](https://github.com/owncloud/gallery/wiki/Create-Thumbnails)
### Specs
- Collect user(s) or path info from the list of command arguments
- Die if encryption is enabled
- Compute path to analyse
- Only work with folders starting with `/<user>/files`
- Scan the given path using Cache\Scanner in order to work with reliable data
- Update the DB cache
- Generate previews **only for media types supported by the Gallery and for which we have a preview provider**
- Collect stats
#### Stats
- # of folders
- # of files
- # of images
- # of previews generated
- # of failed previews (listed)
- Time to complete request
- Last scanned file
- Size of processed data
### TODO
- [x] Quit if encryption is enabled
- [x] Only scan a mounted volume if previews are enabled for that storage location
- [x] Restrict scan to `/<user>/files`
- [x] Add some stats
- [x] Add a switch to force the regeneration of thumbnails
- [x] ~~Offer a safer scanning option, with transactional locking. I'm hoping this will solve the error 1205 problems and not create more problems when trying to generate thumbnails~~
- [x] Presents stats even if operation was cancelled
- [ ] Add tests
- [ ] Make operation cancelling optional
- [ ] Use [OCP\Files\Cache\IPropagator](https://github.com/owncloud/core/blob/master/lib/public/files/cache/ipropagator.php) on 9
- [ ] Check if this is fixed https://github.com/owncloud/core/issues/17196
### Possible extensions
For future PRs
- Make coffee
- Support mimetype as a filter
## Delete thumbnails
### Documentation
[Delete thumbnails](https://github.com/owncloud/gallery/wiki/Delete-Thumbnails)
### Specs
- Collect user(s) or path info from the list of command arguments
- We do not care about encryption
- Wipe the thumbnails folders if we're asked to remove thumbnails for one, a few or all users
- Compute path to analyse in all other cases
- Search for files **of media type supported by Gallery and for which we have a preview provider** and delete as we go
- Collect stats
#### Stats
- # of images
- # of thumbnails deleted
- # of failed deletion (listed)
- Time to complete request
- Saved space
### Possible extensions
For future PRs
- There could be an option to delete thumbnails for all files. This would only be useful if the providers were changed in between the time the thumbnails were generated and the time at which the command is run
### TODO
- [x] Find an easy way to update the cache without re-scanning
- [x] Fix bug in core which prevents the use of a shared folder as the path (sub-folders work) https://github.com/owncloud/core/issues/19544 (8.1+)
- [x] Ask confirmation before launching the operation as we're deleting files from the system
- [ ] Add tests
## Notes
Of course, it would be much more useful to be able to run that from a cron, from the user's settings panel, etc. so don't hesitate to improve this solution ;)
@mmattel @setnes @EricReiche @jospoortvliet @DeepDiver1975 @icewind1991 @Xenopathic @demattin @thedd @patman15 @africanforest @MorrisJobke @PVince81 @libasys @mbazdell @blackm
You would add the files to your DB instead of generating previews.
1 Like