diff options
author | Nicholas Piper <nicholas@users.sourceforge.net> | 2007-01-23 14:10:40 +0000 |
---|---|---|
committer | Nicholas Piper <nicholas@users.sourceforge.net> | 2007-01-23 14:10:40 +0000 |
commit | 23c4a346fd6b33fdd33d109ecbeee1bc5d55854d (patch) | |
tree | deff07d2cec871c9f164e2f1ff946e1fd362a8ef /bindings | |
parent | c79615473bb3b305dcbeef3ccab86a1c7ec85f82 (diff) | |
download | libgpod-23c4a346fd6b33fdd33d109ecbeee1bc5d55854d.tar.gz libgpod-23c4a346fd6b33fdd33d109ecbeee1bc5d55854d.tar.xz libgpod-23c4a346fd6b33fdd33d109ecbeee1bc5d55854d.zip |
Correction to how we fall back to using md5_hash entry from ext database if sha1_hash key isn't found.
git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1390 f01d2545-417e-4e96-918e-98f8d0dbbcb6
Diffstat (limited to 'bindings')
-rw-r--r-- | bindings/python/gtkpod.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/bindings/python/gtkpod.py b/bindings/python/gtkpod.py index be3ebfc..09d222c 100644 --- a/bindings/python/gtkpod.py +++ b/bindings/python/gtkpod.py @@ -141,9 +141,15 @@ def parse(filename, db, itunesdb_file=None): tracks_by_sha[sha1_hash(track.ipod_filename())] = track for ext_block in ext_data.values(): try: - track = tracks_by_sha[ext_block['sha1_hash']] + if ext_block.has_key('sha1_hash'): + track = tracks_by_sha[ext_block['sha1_hash']] + elif ext_block.has_key('md5_hash'): + # recent gpod uses sha1_hash, older uses md5_hash + track = tracks_by_sha[ext_block['md5_hash']] except KeyError: - # recent gpod uses sha1_hash, older uses md5_hash - track = tracks_by_sha[ext_block['md5_hash']] + # what should we do about this? + print "Failed to match hash from extended information file with one that we just calculated:" + print ext_block + continue track['userdata'] = ext_block |