mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-10 05:34:36 +00:00
[#200 state:fixed] Fixed a KeyError wihle parsing iTunes XML.
This commit is contained in:
parent
a99c40b5d8
commit
3441e51c0e
@ -86,11 +86,11 @@ def get_itunes_songs(plistpath):
|
|||||||
plist = plistlib.readPlistFromBytes(s.encode('utf-8'))
|
plist = plistlib.readPlistFromBytes(s.encode('utf-8'))
|
||||||
result = []
|
result = []
|
||||||
for song_data in plist['Tracks'].values():
|
for song_data in plist['Tracks'].values():
|
||||||
if song_data['Track Type'] != 'File':
|
|
||||||
continue
|
|
||||||
try:
|
try:
|
||||||
|
if song_data['Track Type'] != 'File':
|
||||||
|
continue
|
||||||
song = ITunesSong(song_data)
|
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
|
continue
|
||||||
if io.exists(song.path):
|
if io.exists(song.path):
|
||||||
result.append(song)
|
result.append(song)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user