In beet modify: don't ask for confirmation if there is nothing to do

This commit is contained in:
Bruno Tournay 2014-02-03 22:17:57 +01:00
parent 591bc4f348
commit 1f46ff4604

View file

@ -1155,11 +1155,16 @@ def modify_items(lib, mods, query, write, move, album, confirm):
if _showdiff(field, obj.get(field), value):
changed.add(obj)
# Confirm.
if confirm:
extra = ' and write tags' if write else ''
if not ui.input_yn('Really modify%s (Y/n)?' % extra):
return
# Still something to do?
if not changed:
print_('No modification to perform.')
return
else:
# Confirm.
if confirm:
extra = ' and write tags' if write else ''
if not ui.input_yn('Really modify%s (Y/n)?' % extra):
return
# Apply changes to database.
with lib.transaction():