mirror of
https://github.com/beetbox/beets.git
synced 2025-12-31 21:12:43 +01:00
acousticbrainz (#1787): Write tags
Now that we modify the built-in field, this is necessary.
This commit is contained in:
parent
b44601176a
commit
4041c3ceb2
1 changed files with 7 additions and 6 deletions
|
|
@ -42,7 +42,7 @@ class AcousticPlugin(plugins.BeetsPlugin):
|
|||
|
||||
def func(lib, opts, args):
|
||||
items = lib.items(ui.decargs(args))
|
||||
fetch_info(self._log, items)
|
||||
fetch_info(self._log, items, ui.should_write())
|
||||
|
||||
cmd.func = func
|
||||
return [cmd]
|
||||
|
|
@ -52,11 +52,11 @@ class AcousticPlugin(plugins.BeetsPlugin):
|
|||
"""
|
||||
|
||||
items = task.imported_items()
|
||||
fetch_info(self._log, items)
|
||||
fetch_info(self._log, items, False)
|
||||
|
||||
|
||||
def fetch_info(log, items):
|
||||
"""Currently outputs MBID and corresponding request status code.
|
||||
def fetch_info(log, items, write):
|
||||
"""Get data from AcousticBrainz for the items.
|
||||
"""
|
||||
|
||||
def get_value(*map_path):
|
||||
|
|
@ -153,9 +153,10 @@ def fetch_info(log, items):
|
|||
"tonal", "key_stength"
|
||||
)
|
||||
|
||||
# Store the data. We only update flexible attributes, so we
|
||||
# don't call `item.try_write()` here.
|
||||
# Store the data.
|
||||
item.store()
|
||||
if write:
|
||||
item.try_write()
|
||||
|
||||
|
||||
def generate_url(mbid, level):
|
||||
|
|
|
|||
Loading…
Reference in a new issue