acoustid / chromaprint

C library for generating audio fingerprints used by AcoustID
Other
971 stars 133 forks source link

Duration printed as double in fpcalc breaks picard #30

Closed mineo closed 7 years ago

mineo commented 7 years ago

In https://github.com/metabrainz/picard/blob/master/picard/acoustid.py#L204-L205, DURATION=xxx is parsed as an integer by casting with Pythons int constructor. This doesn't support any kind of decimal specifiers and doesn't automatically floor or ceil the value. https://github.com/acoustid/chromaprint/blob/master/src/cmd/fpcalc.cpp#L195 however now prints the duration with a minimum of 2 digits after the decimal point.

You can probably guess the error message by now, but here it is for search engines :):

Traceback (most recent call last):
  File "./picard/acoustid.py", line 205, in _on_fpcalc_finished
    duration = int(parts[1])
ValueError: invalid literal for int() with base 10: '280.49'
lalinsky commented 7 years ago

This change was intentional, but I didn't realize it would break Picard.

I guess I'll revert to the original format in the default output, but keep the precise version the JSON output.

lalinsky commented 7 years ago

Fixed in 318b56495715.