mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 08:39:17 +01:00
Remove check for supported formats in absubmit
Also lower the logging to warning if the extractor fails to analyse a file
This commit is contained in:
parent
aab84413ec
commit
71aab6d743
1 changed files with 1 additions and 10 deletions
|
|
@ -90,10 +90,6 @@ class AcousticBrainzSubmitPlugin(plugins.BeetsPlugin):
|
||||||
self.extractor_sha.update(extractor.read())
|
self.extractor_sha.update(extractor.read())
|
||||||
self.extractor_sha = self.extractor_sha.hexdigest()
|
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'
|
base_url = 'https://acousticbrainz.org/api/v1/{mbid}/low-level'
|
||||||
|
|
||||||
def commands(self):
|
def commands(self):
|
||||||
|
|
@ -119,11 +115,6 @@ class AcousticBrainzSubmitPlugin(plugins.BeetsPlugin):
|
||||||
self._log.info(u'Not analysing {}, missing '
|
self._log.info(u'Not analysing {}, missing '
|
||||||
u'musicbrainz track id.', item)
|
u'musicbrainz track id.', item)
|
||||||
return None
|
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
|
# Temporary file to save extractor output to, extractor only works
|
||||||
# if an output file is given. Here we use a temporary file to copy
|
# if an output file is given. Here we use a temporary file to copy
|
||||||
|
|
@ -136,7 +127,7 @@ class AcousticBrainzSubmitPlugin(plugins.BeetsPlugin):
|
||||||
try:
|
try:
|
||||||
call([self.extractor, util.syspath(item.path), filename])
|
call([self.extractor, util.syspath(item.path), filename])
|
||||||
except ABSubmitError as e:
|
except ABSubmitError as e:
|
||||||
self._log.error(
|
self._log.warning(
|
||||||
u'Failed to analyse {item} for AcousticBrainz: {error}',
|
u'Failed to analyse {item} for AcousticBrainz: {error}',
|
||||||
item=item, error=e
|
item=item, error=e
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue