Optimize `/api/scanstate` on huge libraries
Optimize `/api/scanstate` on huge libraries

This endpoint is now optimized for cases where all/most of the files are
already scanned (which should be the case 99% of the times). This
happens by filtering out the already scanned audio files from all
available audio files before checking the exact mime type and possible
exclusion of the file path. When there are tens of thousands of files,
these checks may be surprisingly costly: With the optimization, the time
used on the test library with 62k+ tracks was reduced from ~24s to ~15s.

paulijar/music,paulijar/music,owncloud/music,owncloud/music,paulijar/music,owncloud/music,paulijar/music,owncloud/music,owncloud/music,paulijar/music