3 ms·
Wow this is awesome stuff, thank you very much. My current solution / plan is: - Get byte offsets of the audio stream only (e.g. 384, 834882948) - Ignore meta
by sandreas 4y ago
Wow this is awesome stuff, thank you very much.
My current solution / plan is:
- Get byte offsets of the audio stream only (e.g. 384, 834882948)
- Ignore metadata and build xxhash only over this part
- To be faster, build the hash over 5MB in the center
- If a new file is indexed, build hash and look it up in the database
- If one match is found, assume this is the file
- If 0 or more than one, assume new file
The edge case of 2 or more with the same hash has never happened. Worked out pretty well so far, although its not perfect.
And C# File API provides FileWatcher possibility, so I get notified whenever there is a change.
The first run has to be done as full scan, after starting the full scan, a FileWatcher is registered and pushes to the Queue whenever a file has changed.
It's far from perfect, but it works.