It doesn't freeze for me, using current source and in debug mode.
The only library I have with extra files is small, 100 books. The search is near instantaneous. On a large library with 77,000 books but no extra files the search takes a few seconds.
The function will take a while to run. It must look in every book folder to see if there is a non-empty data subfolder. The answer is cached so the future runs will be faster. The cache is cleared whenever an operation changes the contents of one of the folders.
Of note: has_extra_files() is not affected by the changes I made to get_metadata(). It doesn't use it.
Questions:
- What happens if you are running in debug mode?
- How long did you wait? Does it eventually finish if you wait a long time?
- Is it using the processor?
- Is it using the disk/ssd?