previewgenerator icon indicating copy to clipboard operation
previewgenerator copied to clipboard

exclude folders/shares

Open k4tfish opened this issue 7 years ago • 13 comments

is it possible to exclude certain folders from preview generation?

k4tfish avatar Sep 07 '17 19:09 k4tfish

I definitely second that. Especially all these Apple-Generated directory corpses laying around. .AppleDouble, .trash, tmp etc. could all be skipped.

HaleyACS avatar Nov 27 '17 11:11 HaleyACS

I think this has been solved: if a file with the name .nomedia is added to the folder, the folder will not be scanned. I tested this, and it worked for me.

schniepp avatar Apr 11 '18 23:04 schniepp

I've several external storages in my nextcloud installation and I would like to exclude them via an argument because I don't have write access to add .nomedia files.

dnnspaul avatar Jul 04 '18 11:07 dnnspaul

Same thing, but I want to include only directories with a valuable data. In my case, rest of generated previews will never be used.

Loriowar avatar Jul 28 '18 19:07 Loriowar

I'd like to see this update. To add to it I'd also like to exclude preview generation as dictated by regex patterns, file types, extensions, specified folders, external storages etc...

Let me know if help is needed, I could spare some time...

iv1k avatar Apr 30 '19 16:04 iv1k

preview generator is now working on my trashbin which is totally unnecessary. it would be nice to exclude some directories (or have trash be excluded by default).

zsbolyoczki avatar Oct 06 '20 14:10 zsbolyoczki

Being able to exclude the trash is important. A waste of CPU time and disk space to constantly be running on the trash. I've run into this specifically using Joplin which creates temp files that get moved to trash immediately. Potentially hundreds of files a day which definitely do not need previews generated for.

Wdavery avatar Mar 19 '21 14:03 Wdavery

Unfortunately adding a file .nomedia like mentioned by @schniepp i.e. to the files_trashbin-folder does not solve the problem. The occ preview:pre-generate-command still creates thumbnails for deleted files which beside wasting disk space is a waste of energy!

hajo62 avatar May 03 '21 20:05 hajo62

I second this, it's been 3 years and it's still an important feature

ozls avatar May 19 '21 16:05 ozls

As #374 has been closed in favor of this issue, I would like to ask for your opinion.

You are welcome to react with :tada: or :rocket: depending on which suggestion you prefer most. And also feel free to reply with further notes.

:tada: ) Mechanism to exclude some folders from preview generation

  • E.g. list of paths or regex pattern as @iv1k suggested.
  • This allows easy exclusion of e.g. a trash directory.

:rocket: ) Mechanism to include only selected folders for preview generation

  • E.g. list of paths.
  • This would be similar to the Gallery 2.0 app where one can set the path to the photos directory. If one has few media folders but many documents and files elsewhere it could be useful to only enable preview generation for those media folders.

langfingaz avatar Apr 12 '23 13:04 langfingaz

Furthermore, I'm not sure if the previewgenerator app is the ideal place to implement this.

This app does the pre-generation of preview images. If we disalbe the pre-generation for some files here, this doesn't mean that preview images are not generated based on user interaction (if the user views a folder in the app that was excluded during pre-generation).

According to the Nextcloud manual, one has only the option to either completely disable previews or let them enabled. https://docs.nextcloud.com/server/stable/admin_manual/configuration_files/previews_configuration.html?highlight=preview#parameters

Wouldn't it be better if we could disable previews for specific folders (or enable it only for some directories)?

  • This way, if one runs the pre-generation for all folders, Nextcloud itself could detect if some files are in a directory that is excluded from preview image generation and would skip those.
  • And if a user manually views a directory that is excluded from preview generation, he/she would not need to wait until the preview images get generated but would directly see the generic placeholder icons.

Well, but maybe it is "easier/faster" to just implement it here? ^^ However, with a long term perspective in mind I think that adding this functionality in the general preview settings could be better.

langfingaz avatar Apr 12 '23 13:04 langfingaz

I have some good news: Files in the trash bin are now excluded when running pre-generate.

Manually excluding paths is still pending and contributions are always welcome.

st3iny avatar Apr 19 '23 07:04 st3iny

I've noticed when using the preview generator for an individual user, it will end up scanning my external storage in addition the user directory. So it is stepping outside of the userid directory which is not a desired behavior.

It threw me off for a min, because for a min I thought, WTF is this user doing copying all the external files into their own directory, but reviewing the userid directory tree, I didn't see the files present.

su -m abc -c 'php /config/www/nextcloud/occ preview:generate-all <userid>'

fireheadman avatar May 22 '23 05:05 fireheadman