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

  • Participants
  • Parent commits 6cf0b92
  • Branches default

Comments (0)

Files changed (2)

File beetsplug/

     """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)