Refreshing an in-place imported library takes way too long
Steps to reproduce
- Import a large music library (mine is ~300 GB) with
python manage.py import_files {id} {filepath} --recursive --noinput --in-place
- Add/remove/change some files in the given folder
- Refresh the library with the same command as above
What happens?
This takes an incredibly long time. It will be 35 batches and each of them will take over a minute, so it takes like something between 30 and 45 minutes complete
What is expected?
I would expect this to be substantially faster than the initial import is. I threw various music management solutions at this setup already and pretty much all of them can do a full metadata refresh in somewhere between two and five minutes
Context
Funkwhale version(s) affected: 1.2.10
I dug around the sourcecode a bit, and I am pretty sure that this happens, because a refresh hashes every single file again. This seems really overeager, since you could compare the filesize and modification date with the given file first (i am somewhat certain that both are available) before loading the file at all, which hopefully should net a big performance increase. If that is implemented, it might make sense to add another CLI argument to force a hard refresh that actually does check all the hashes to account for any synchronization weirdnesses that might maybe occur