From 27f561807a4d88ae2193b59953b874a8d9ed80ec Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Thu, 27 May 2010 09:49:25 -0700 Subject: [PATCH] more consistency in tagging questions --- beets/ui.py | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/beets/ui.py b/beets/ui.py index 26f4c1707..ca13b86d8 100644 --- a/beets/ui.py +++ b/beets/ui.py @@ -68,7 +68,7 @@ def choose_candidate(items, cur_artist, cur_album, candidates): sel = None while not sel: # Ask the user for a choice. - inp = raw_input('Enter a number or "s" to skip: ') + inp = raw_input('Number or Skip? ') inp = inp.strip() if inp.lower().startswith('s'): return None @@ -78,6 +78,8 @@ def choose_candidate(items, cur_artist, cur_album, candidates): pass if not (1 <= sel <= len(candidates)): sel = None + if not sel: + print 'Please enter a numerical selection or S.' dist, info = candidates[sel-1] bypass_candidates = False @@ -94,10 +96,25 @@ def choose_candidate(items, cur_artist, cur_album, candidates): if item.title != track_data['title']: print " * %s -> %s" % (item.title, track_data['title']) - # Warn if change is significant. - if dist > 0.0: - if _input_yn("Apply change ([y]/n)? "): + # Exact match => tag automatically. + if dist == 0.0: + return info + + # Ask for confirmation. + while True: + inp = raw_input('[A]pply, More candidates, or Skip? ') + inp = inp.strip() + if inp.lower().startswith('a') or inp == '': + # Apply. return info + if inp.lower().startswith('m'): + # More choices. + break + if inp.lower().startswith('s'): + # Skip. + return None + # Invalid selection. + print "Please enter A, M, or S." def tag_album(items, lib, copy=True, write=True): """Import items into lib, tagging them as an album. If copy, then