Merge pull request #2478 from inytar/remove_supported_formats

Remove supported formats check from absubmit
This commit is contained in:
Adrian Sampson 2017-03-18 14:13:58 -04:00
commit 6814bad90e
3 changed files with 4 additions and 11 deletions

View file

@ -90,10 +90,6 @@ class AcousticBrainzSubmitPlugin(plugins.BeetsPlugin):
self.extractor_sha.update(extractor.read())
self.extractor_sha = self.extractor_sha.hexdigest()
supported_formats = {'mp3', 'ogg', 'oga', 'flac', 'mp4', 'm4a', 'm4r',
'm4b', 'm4p', 'aac', 'wma', 'asf', 'mpc', 'wv',
'spx', 'tta', '3g2', 'aif', 'aiff', 'ape'}
base_url = 'https://acousticbrainz.org/api/v1/{mbid}/low-level'
def commands(self):
@ -119,11 +115,6 @@ class AcousticBrainzSubmitPlugin(plugins.BeetsPlugin):
self._log.info(u'Not analysing {}, missing '
u'musicbrainz track id.', item)
return None
# If file format is not supported skip it.
if item['format'].lower() not in self.supported_formats:
self._log.info(u'Not analysing {}, file not in '
u'supported format.', item)
return None
# Temporary file to save extractor output to, extractor only works
# if an output file is given. Here we use a temporary file to copy
@ -132,10 +123,11 @@ class AcousticBrainzSubmitPlugin(plugins.BeetsPlugin):
tmp_file, filename = tempfile.mkstemp(suffix='.json')
try:
# Close the file, so the extractor can overwrite it.
os.close(tmp_file)
try:
call([self.extractor, util.syspath(item.path), filename])
except ABSubmitError as e:
self._log.error(
self._log.warning(
u'Failed to analyse {item} for AcousticBrainz: {error}',
item=item, error=e
)

View file

@ -43,6 +43,7 @@ New features:
Fixes:
* :doc:`/plugins/absubmit`: Do not filter for supported formats. :bug:`2471`
* :doc:`/plugins/mpdupdate`: Fix Python 3 compatibility. :bug:`2381`
* :doc:`/plugins/replaygain`: Fix Python 3 compatibility in the ``bs1770gain``
backend. :bug:`2382`

View file

@ -9,7 +9,7 @@ Installation
The `absubmit` plugin requires the `streaming_extractor_music`_ program to run. Its source can be found on `GitHub`_, and while it is possible to compile the extractor from source, AcousticBrainz would prefer if you used their binary (see the AcousticBrainz `FAQ`_).
The `absubmit` also plugin requires `requests`_, which you can install using `pip_` by typing::
The `absubmit` also plugin requires `requests`_, which you can install using `pip`_ by typing::
pip install requests