From c1e90aa7b8244921c892ee5ccb2ee162ed2bc5fd Mon Sep 17 00:00:00 2001 From: Wieland Hoffmann Date: Tue, 16 Aug 2011 14:30:25 +0200 Subject: [PATCH] Try to detect duplicate ISRCs --- isrcsubmit-cdrdao.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/isrcsubmit-cdrdao.py b/isrcsubmit-cdrdao.py index 6b771af..b75e770 100755 --- a/isrcsubmit-cdrdao.py +++ b/isrcsubmit-cdrdao.py @@ -144,8 +144,12 @@ def main(): if len(tracks2isrcs) == 0: print "No new ISRCs could be found." else: - + vals = tracks2isrcs.values() for key, val in tracks2isrcs.items(): + if vals().count(val) > 1: + "The ISRC %s appears multiple times, I'm not going to submit it"\ + % val + tracks2isrcs.pop(key) print "The ISRC %s will be attached to %s" % (val, key) if raw_input("Is this correct? [y/N]").lower() != "y": tracks2isrcs.pop(key)