Commits

Adrian Sampson  committed d3da3fe

echonest_tempo: sanitize newlines from input

The Echo Nest API confusingly says that the input is missing if it contains a
newline.

  • Participants
  • Parent commits 6cf0b92

Comments (0)

Files changed (2)

File beetsplug/echonest_tempo.py

     """Get the tempo for a song."""
     # We must have sufficient metadata for the lookup. Otherwise the API
     # will just complain.
+    artist = artist.replace(u'\n', u' ').strip()
+    title = title.replace(u'\n', u' ').strip()
     if not artist or not title:
         return None
 

File docs/changelog.rst

 1.1b3 (in development)
 ----------------------
 
+* :doc:`/plugins/echonest_tempo`: Avoid an error when track metadata contains
+  newlines.
+
 1.1b2 (February 16, 2013)
 -------------------------