From f40517b09e1a5c941a787705f24b1974b20d5d49 Mon Sep 17 00:00:00 2001 From: Bruno Cauet Date: Sat, 7 Jun 2014 20:36:05 +0200 Subject: [PATCH] Show file path when deleting items Using `beets remove -d " now shows the file path when asking for confirmation. The format string is '$path - $title'. Fix issue #320. --- beets/ui/commands.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/beets/ui/commands.py b/beets/ui/commands.py index b660cd9e4..deffaa0ee 100644 --- a/beets/ui/commands.py +++ b/beets/ui/commands.py @@ -1056,17 +1056,21 @@ def remove_items(lib, query, album, delete): # Get the matching items. items, albums = _do_query(lib, query, album) - # Show all the items. - for item in items: - ui.print_obj(item, lib) - - # Confirm with user. + # Prepare confirmation with user. print_() if delete: + fmt = u'$path - $title' prompt = 'Really DELETE %i files (y/n)?' % len(items) else: + fmt = None prompt = 'Really remove %i items from the library (y/n)?' % \ len(items) + + # Show all the items. + for item in items: + ui.print_obj(item, lib, fmt) + + # Confirm with user if not ui.input_yn(prompt, True): return