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

Remove supported formats check from absubmit #2478

Merged
merged 6 commits into from
Mar 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions beetsplug/absubmit.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,6 @@ def __init__(self):
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):
Expand All @@ -119,11 +115,6 @@ def _get_analysis(self, item):
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
Expand All @@ -132,10 +123,11 @@ def _get_analysis(self, item):
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
)
Expand Down
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion docs/plugins/absubmit.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down