Delete previews
Provides a new occ command to delete previews, with options:
- to only delete previews of original files that no longer exist
- to only delete previews of files of a specific mimetype
- to delete previews in batches of a specified number, for database access performance purpose
Tested on NC 26, with S3 as primary object storage, and with local storage. Tested all combinations of options. Verified that previews are actually deleted from S3 storage and from filecache.
Addressing these issues (as a manual command): #26014, #20344, #18416, #35290 @szaimen, @solracsf, @arpadmuller, @skjnldsv, @SimplyCorbett, @MorrisJobke
Seems promising. Tested also on local filesystem?
Seems promising. Tested also on local filesystem?
Just tested it on local storage configuration. It worked as well.
php-cs is not happy :)
Autoloader too. Please run: bash build/autoloaderchecker.sh
I tried to fix the checks as much as I could, up to the point I need help :)
- I ran
bash build/autoloaderchecker.sh. It changed 50 files, that I committed. Not sure I had to do that. - I installed phpcs on my laptop. Is there a specific rules file for Nextcloud that I should be using when running phpcs ?
Thanks for your help.
I ran bash build/autoloaderchecker.sh. It changed 50 files, that I committed. Not sure I had to do that.
You can drop them, only add changes from lib/composer/composer/autoload_classmap.php and lib/composer/composer/autoload_static.php.
I installed phpcs on my laptop. Is there a specific rules file for Nextcloud that I should be using when running phpcs ?
It should automatically use the .php-cs-fixer.dist.php file.
conflicts...
I ran bash build/autoloaderchecker.sh. It changed 50 files, that I committed. Not sure I had to do that.
You can drop them, only add changes from
lib/composer/composer/autoload_classmap.phpandlib/composer/composer/autoload_static.php.I installed phpcs on my laptop. Is there a specific rules file for Nextcloud that I should be using when running phpcs ?
It should automatically use the
.php-cs-fixer.dist.phpfile.
I fixed the php-cs issue.
I commited changes to lib/composer/composer/autoload_classmap.php and lib/composer/composer/autoload_static.php following a bash build/autoloaderchecker.sh. But I still get a continuous integration issue and a performance issue. I also tried to commit all autoload files (in addition to the two above), but it did not help.
/rebase
@CarlSchwan To enhance modularity, we could split your preview:reset-rendered-texts command into one command that just deletes avatars (the first part of your command), and use the command I propose here for the second part of your command.
Indeed, my proposed preview:delete command is a generalization (deleting all previews) of the second part of your command, but that can target a specific mimetype with an option, e.g.
preview:delete --mimetype="text/plain".
Except of course if you have a specific use case that requires to delete both avatars and text file previews in one go.
Why is the background job not enough? Should we fix it too?
The background job only deletes remnant previews. This manual command can be used to delete any kind of previews (all previews, remnant previews, non-remnant previews of files of a specific mimetype). I see the following use cases (not exhaustive):
- When a user decides to specify a new preview size (with
preview_max_x/yinconfig.phpor withpreviewgenerator), to delete all previews before generating new sizes - When a user decides to limit previews to certain file types (with
enabledPreviewProvidersinconfig.php) (eg. just for pictures and no longer for text files), to delete previews that are no longer used (and save related space) - When a user decides to stop using previews (with
enable_previews => falseinconfig.php), to delete all previews (for space or performance issues)
Yet another use case where we need a native Delete Preview command:
The Memories app configuration page reads:
If you already generated previews and want to regenerate, run the following (at your own risk; have backups)
rm -rf <nextcloud-data-dir>/appdata_*/preview occ files:scan-app-data
This rm command won't work with an S3 storage.
Please include the command I'm proposing in this pull request.
Hi, this PR is still active? Because i need it for fix my s3 issues 🙄
up ?
up ?
I hope it is still active. I've been waiting for review and approval.
I have fixed conflicts with latest master a few times. I can fix them again if I know there is an intention to include this PR.
up ?
I hope it is still active. I've been waiting for review and approval.
I have fixed conflicts with latest master a few times. I can fix them again if I know there is an intention to include this PR.
I hope too, in the meantime I deactivate previews...
@charleypaulus Please fix the conflicts in this PR, it's running a little late but hopefully this will get in for NC30