* fixed code to prevent refingerprinting song if it is already fingerprinted in fingerprint_file()
* fixed code to prevent multiple fingerprinting of songs in same dejavu instance
List of changes in detail:
- fingerprint_directory:
Now uses mp.Pool.imap and updates database in callers
process.
- fingerprint_file:
Now uses _fingerprint_worker internally.
- _fingerprint_worker:
Some slight changes to argument handling due to `imap`
usage.
Changed to return (song_name, hashes) where hashes is
a set of hashes from all channels.
- path_to_songname:
Changed to use `os.path.splitext`, this caused files with
a period in their name to return the wrong name.
Fixed an issue of 'grouper' items being generators due to ifilter usage.
Temporary fix applied for the need of referencing SQLDatabase.FIELD_SONGNAME in __init__
Cleaned up some pep8 style issues
- Moved SQLDatabase to a SQL specific file
- Database class is now an abstract base class
- Cursor moved into SQL specific file
- Allowed for multi-database support in the future
Changes in no particular order:
- Replaced all use cases of wavfile/wave and extract_channels with the new decoder.read function
- Added a 'recognize' method to the Dejavu class. This is a shortcut for recognizing songs.
- Renamed 'do_fingerprint' into 'fingerprint_directory'
- Removed parameters not required anymore from fingerprint_directory
- Cleaned up fingerprint.py
- Made fingerprint.generate_hashes a generator
- WaveFileRecognizer is now FileRecognizer and can take any formats supported by pydub
- Fixed MicrophoneRecognizer to actually run, previous version had many small mistakes
- Renamed 'fingerprint_worker' to '_fingerprint_worker' to signify it is not to be used publicly
- Moved 'chunkify' outside the Dejavu class
- Cleaned up pep8 styling mistakes in all edited files.
- 'Converter' class removed
- 'ensure_folder' removed
- 'find_files' changed into a generator and made it work with spaces
- 'convert' renamed into 'read'
- 'convert' now handles any supported file by pydub
- 'convert' now returns the data instead of saving it to a file (same format as 'extract_channels')
- generic cleanup of formatting in the file
- Fixes SQL queries for table creations
- Table creation is now down in reverse order to accompany the foreign key
- Fixed a typo in the BaseRecognizer that caused it to not work
- Changed configuration passed to Dejavu into a (nested) dictionary