diff options
author | Nicholas Piper <nicholas@users.sourceforge.net> | 2007-01-14 22:25:25 +0000 |
---|---|---|
committer | Nicholas Piper <nicholas@users.sourceforge.net> | 2007-01-14 22:25:25 +0000 |
commit | afbb612b485982bca823edca91e43997aa810cc6 (patch) | |
tree | f2f24ac51fa15c25e2bbc84675664ad860c6e29f /bindings | |
parent | 78a7d8e3b4ed5c4eab7d1f6cda419f7a60f612f1 (diff) | |
download | libgpod-tmz-afbb612b485982bca823edca91e43997aa810cc6.tar.gz libgpod-tmz-afbb612b485982bca823edca91e43997aa810cc6.tar.xz libgpod-tmz-afbb612b485982bca823edca91e43997aa810cc6.zip |
Correction to 1.4 - sha1/md5_hash handling in ext db. Also, don't write filename_ipod if we don't have a value for it.
git-svn-id: https://gtkpod.svn.sf.net/svnroot/gtkpod/libgpod/trunk@1369 f01d2545-417e-4e96-918e-98f8d0dbbcb6
Diffstat (limited to 'bindings')
-rw-r--r-- | bindings/python/gtkpod.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/bindings/python/gtkpod.py b/bindings/python/gtkpod.py index 83f460b..3a1260b 100644 --- a/bindings/python/gtkpod.py +++ b/bindings/python/gtkpod.py @@ -53,14 +53,19 @@ def write(filename, db, itunesdb_file): write_pair("id", track['id']) if not track['userdata']: track['userdata'] = {} - track['userdata']['filename_ipod'] = track['ipod_path'] + if track['ipod_path']: + track['userdata']['filename_ipod'] = track['ipod_path'] + hash_name = 'sha1_hash' try: - hash_name = 'sha1_hash' del track['userdata'][hash_name] except KeyError: # recent gpod uses sha1_hash, older uses md5_hash - hash_name = 'md5_hash' - del track['userdata'][hash_name] + try: + del track['userdata'][hash_name] + hash_name = 'md5_hash' + except KeyError: + # we'll just write a sha1_hash then + pass if track['userdata'].has_key('filename_locale') and not track['userdata'].has_key(hash_name): if os.path.exists(track['userdata']['filename_locale']): track['userdata'][hash_name] = sha1_hash( |