Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"TypeError" exception when a song is not recognized #1

Closed
pguridi opened this issue Nov 28, 2013 · 0 comments
Closed

"TypeError" exception when a song is not recognized #1

pguridi opened this issue Nov 28, 2013 · 0 comments

Comments

@pguridi
Copy link
Contributor

pguridi commented Nov 28, 2013

when checking a song and there is no positive match, using:
..
recognizer = Recognizer(dejavu.fingerprinter, config)
res = recognizer.read("14622976.wav")

throws the following exception, would be nice if a "NotFound" exception is throwed instead.
*EDIT: or return None.

Traceback (most recent call last):
  File "checksong.py", line 14, in <module>
    res = recognizer.read("14622976.wav")
  File "dejavu/dejavu/recognize.py", line 40, in read
        return self.fingerprinter.align_matches(matches, starttime, verbose=verbose)
  File "dejavu/dejavu/fingerprint.py", line 206, in align_matches
    songname = self.db.get_song_by_id(song_id)    [SQLDatabase.FIELD_SONGNAME]
TypeError: 'NoneType' object has no attribute '__getitem__'
Resident234 added a commit to Resident234/dejavu that referenced this issue Sep 26, 2019
worldveil pushed a commit that referenced this issue Jun 2, 2020
After restructuring the modules, also the documentation needs to be updated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant