From 3441e51c0e6f47c097578d95543ff6382e1f8250 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Thu, 9 Aug 2012 10:01:44 -0400 Subject: [PATCH] [#200 state:fixed] Fixed a KeyError wihle parsing iTunes XML. --- cocoa/inter/app_me.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cocoa/inter/app_me.py b/cocoa/inter/app_me.py index fa27306a..5fb10d0c 100644 --- a/cocoa/inter/app_me.py +++ b/cocoa/inter/app_me.py @@ -86,11 +86,11 @@ def get_itunes_songs(plistpath): plist = plistlib.readPlistFromBytes(s.encode('utf-8')) result = [] for song_data in plist['Tracks'].values(): - if song_data['Track Type'] != 'File': - continue try: + if song_data['Track Type'] != 'File': + continue song = ITunesSong(song_data) - except KeyError: # No "Location" or "Track ID" key in track + except KeyError: # No "Track Type", "Location" or "Track ID" key in track continue if io.exists(song.path): result.append(song)