Auto-scale Picture

It is not recommended way of working with NC, but you need to run β€œscan” command to rescan files under the path, or whole NC filesystem:

sudo -u www-data php occ files:scan --path="user_id/files/mount_name/path"

E.g.

sudo -u www-data php occ files:scan --path="/alice/files/Music"

β†’ Doku: Using the occ command β€” Nextcloud 15 Administration Manual 15 documentation

My sgesstion is to added some local folder as Nextcloud external storage and work with your scripts direct there. Afterwards ether run rescan command, or do periodical external shares rescan. I wrote small script for a cron job, to do periodically external shares rescan. Will also generate small report in your logs:
image