Update of /cvsroot/gtkpod/libgpod/bindings/python
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv15552

Modified Files:
        gtkpod.py 
Log Message:
Correction to how we fall back to using md5_hash entry from ext database if 
sha1_hash key isn't found.

Index: gtkpod.py
===================================================================
RCS file: /cvsroot/gtkpod/libgpod/bindings/python/gtkpod.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- gtkpod.py   14 Jan 2007 22:44:33 -0000      1.6
+++ gtkpod.py   23 Jan 2007 14:10:40 -0000      1.7
@@ -141,9 +141,15 @@
             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
 


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2

Reply via email to