From e87fe0a96cdf8b51ae79c6446c58d203b2a6e61f Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sat, 7 May 2011 03:12:20 -0400 Subject: Fix dem bugs. --- scanner/PhotoAlbum.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'scanner/PhotoAlbum.py') diff --git a/scanner/PhotoAlbum.py b/scanner/PhotoAlbum.py index e88fef4..367c56c 100644 --- a/scanner/PhotoAlbum.py +++ b/scanner/PhotoAlbum.py @@ -140,7 +140,7 @@ class Photo(object): decoded = TAGS.get(tag, tag) if isinstance(value, str): value = value.strip() - if decoded.startswith("DateTime"): + if isinstance(decoded, str) and decoded.startswith("DateTime"): try: value = datetime.strptime(value, '%Y:%m:%d %H:%M:%S') except: @@ -279,7 +279,7 @@ class Photo(object): path = os.path.join(basepath, dictionary["name"]) del dictionary["name"] for key, value in dictionary.items(): - if key.startswith("DateTime"): + if key.startswith("dateTime"): try: dictionary[key] = datetime.strptime(dictionary[key], "%a %b %d %H:%M:%S %Y") except: -- cgit v1.2.3-59-g8ed1b