mirror of
https://github.com/arsenetar/dupeguru.git
synced 2026-01-22 22:51:39 +00:00
[#200 state:fixed] Fixed a KeyError wihle parsing iTunes XML.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user