Skip to content

Commit

Permalink
fixup! linter is happy
Browse files Browse the repository at this point in the history
  • Loading branch information
tandy-1000 committed Sep 30, 2023
1 parent 5647180 commit 6df94e8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions beetsplug/autobpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
from librosa import load, beat
from soundfile import LibsndfileError

class AutoBPMPlugin(BeetsPlugin):

class AutoBPMPlugin(BeetsPlugin):

def __init__(self):
super().__init__()
Expand All @@ -43,7 +43,7 @@ def commands(self):

def command(self, lib, opts, args):
self.calculate_bpm(lib.items(ui.decargs(args)),
write=ui.should_write())
write=ui.should_write())

def imported(self, session, task):
self.calculate_bpm(task.imported_items())
Expand All @@ -54,19 +54,19 @@ def calculate_bpm(self, items, write=False):
for item in items:
if item['bpm']:
self._log.info('found bpm {0} for {1}',
item['bpm'], util.displayable_path(item.path))
item['bpm'], util.displayable_path(item.path))
if not overwrite:
continue

try:
y, sr = load(util.syspath(item.path), res_type="kaiser_fast")
y, sr = load(util.syspath(item.path), res_type='kaiser_fast')
except LibsndfileError as exc:
self._log.error("LibsndfileError: failed to load {0} {1}',
util.displayable_path(item.path), exc)
self._log.error('LibsndfileError: failed to load {0} {1}',
util.displayable_path(item.path), exc)
continue
except ValueError as exc:
self._log.error('ValueError: failed to load {0} {1}',
util.displayable_path(item.path), exc)
util.displayable_path(item.path), exc)
continue

tempo, _ = beat.beat_track(y=y, sr=sr)
Expand Down

0 comments on commit 6df94e8

Please sign in to comment.