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 | 7a6f5f67ecb62f100fce8c86e16c0da5569d4750 (patch) | |
tree | f2f24ac51fa15c25e2bbc84675664ad860c6e29f | |
parent | 46d1443b529ff8c16c8d0a6db53ec3659d43882a (diff) | |
download | libgpod-7a6f5f67ecb62f100fce8c86e16c0da5569d4750.tar.gz libgpod-7a6f5f67ecb62f100fce8c86e16c0da5569d4750.tar.xz libgpod-7a6f5f67ecb62f100fce8c86e16c0da5569d4750.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
-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( |