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

check config opt import/write before try_write from art.py (fixes #1427) #1428

Closed
wants to merge 3 commits into from
Closed
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
4 changes: 3 additions & 1 deletion beets/art.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ def embed_item(log, item, imagepath, maxwidth=None, itempath=None,
except IOError as exc:
log.warning(u'could not read image file: {0}', exc)
return
item.try_write(path=itempath, tags={'images': [image]})

if config['import']['write']:
item.try_write(path=itempath, tags={'images': [image]})


def embed_album(log, album, maxwidth=None, quiet=False,
Expand Down
1 change: 1 addition & 0 deletions beetsplug/embedart.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def commands(self):
ifempty = self.config['ifempty'].get(bool)

def embed_func(lib, opts, args):
config['import']['write'] = True
if opts.file:
imagepath = normpath(opts.file)
if not os.path.isfile(syspath(imagepath)):
Expand Down