nextcloud / previewgenerator

Nextcloud app to do preview generation in the background.
https://apps.nextcloud.com/apps/previewgenerator
GNU Affero General Public License v3.0
455 stars 57 forks source link

`preview:pre-generate` ignores `.nomedia` in ancestor folders of the added/modified folder #433

Closed th0rgall closed 3 weeks ago

th0rgall commented 10 months ago

Context

I have an WebDAV External Storage with pictures, say ExternalPhotos. The root folder of this storage has a .nomedia file. The folders in the storage are organized by YYYY/MM.

I added a folder 01 to 2021, and then ran ./occ preview:generate-all.

This lead to the expected behavior, the 2021/01 folder was skipped, because the root ExternalPhotos was skipped. Log file entry:

2023-11-30T09:51:11+00:00 Skipping folder /thor/files/ExternalPhotos

Problem

Afterwards, I ran ./occ preview:pre-generate. Now it unexpectedly started indexing 2021/01 on the external storage.

...
2023-11-30T11:46:10+00:00 Generating previews for  /thor/files/ExternalPhotos/2021/01/IMG_001.HEIC
...

I presume that this is due to the difference in the behavior commands:

Workaround

This suspicion was further confirmed when I added .nomedia files to 2021 and 2021/01. Now, pre-generate didn't attempt to generate the previews anymore.

Solution?

Is my suspecion about this (for me) unexpected behavior correct?

If so, I think it would be nice if pre-generate scanned all ancestor folders of modified folders for .nomedia files, and not just the folder itself. That would make it behave as I expect.

st3iny commented 10 months ago

Thank you for the detailed analysis! I already have a suspicion what is broken and will try to investigate soon.

astro-1999 commented 6 months ago

Any update on this issue? I have had to disable the app and miss it.

NeilSauv commented 4 months ago

Still no fix ? This is a very annoying problem.

th0rgall commented 3 weeks ago

Hey @astro-1999, @NeilSauv, and others passing by here, if this issue affects you too, consider giving the opening post a 👍 This is more likely to help with prioritization.