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 | 69112a19193354e996bdc29d866af797895dbe76 (patch) | |
tree | deff07d2cec871c9f164e2f1ff946e1fd362a8ef | |
parent | 73ddb08afbde0a6b1eea1eefbaffe121eb9c6914 (diff) | |
download | libgpod-69112a19193354e996bdc29d866af797895dbe76.tar.gz libgpod-69112a19193354e996bdc29d866af797895dbe76.tar.xz libgpod-69112a19193354e996bdc29d866af797895dbe76.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
-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 |