Skip to content

Commit

Permalink
Merge pull request #15 from adamjakab/devel
Browse files Browse the repository at this point in the history
Fixes #14 import issue
  • Loading branch information
adamjakab authored May 11, 2024
2 parents 80ebd66 + 56d025a commit a63658c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions beetsplug/bpmanalyser/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ def commands(self):
return [BpmAnalyserCommand(self.config)]

def imported(self, session, task):
cmd = BpmAnalyserCommand(self.config)
# Add BPM for imported items.
for item in task.imported_items():
if not self.config['force'] and item['bpm'] != 0:
item_path = item.get("path").decode("utf-8")
log.debug("Skipping item with existing BPM[{0}]...".format(item_path))
log.debug("Skipped. Item({}) has already got BPM: {}".format(item_path, item['bpm']))
return
else:
BpmAnalyserCommand(self.config).analyse(item)
cmd.runAnalyser(item)
3 changes: 3 additions & 0 deletions beetsplug/bpmanalyser/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,9 @@ def execute_task_on_items(self, items):

self._say("Done.")

#
# Run the external analyser script on a single item
#
def runAnalyser(self, item: Item):
item_path = item.get("path").decode("utf-8")
log.debug("Analysing[{0}]...".format(item_path))
Expand Down
2 changes: 1 addition & 1 deletion beetsplug/bpmanalyser/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# Created: 2/24/20, 12:09 AM
# License: See LICENSE.txt

__version__ = '1.5.6'
__version__ = '1.5.7'

0 comments on commit a63658c

Please sign in to comment.