diff --git a/elodie/media/media.py b/elodie/media/media.py index 3c1ac31..ad698a4 100644 --- a/elodie/media/media.py +++ b/elodie/media/media.py @@ -300,14 +300,18 @@ class Media(object): return False source = self.source + stat = os.stat(source) exiftool_config = constants.exiftool_config if(constants.debug == True): print '%s -config "%s" -xmp-elodie:Album="%s" "%s"' % (exiftool, exiftool_config, name, source) process_output = subprocess.Popen(['%s -config "%s" -xmp-elodie:Album="%s" "%s"' % (exiftool, exiftool_config, name, source)], stdout=subprocess.PIPE, shell=True) streamdata = process_output.communicate()[0] + if(process_output.returncode != 0): return False + os.utime(source, (stat.st_atime, stat.st_mtime)) + exiftool_backup_file = '%s%s' % (source, '_original') if(os.path.isfile(exiftool_backup_file) is True): os.remove(exiftool_backup_file) diff --git a/elodie/media/video.py b/elodie/media/video.py index b1857a6..b743c9f 100644 --- a/elodie/media/video.py +++ b/elodie/media/video.py @@ -109,10 +109,6 @@ class Video(Media): if(seconds_since_epoch == 0): return None - # If the time wasn't found in EXIF we need to add it there since the modified/access times frequently change - if(time_found_in_exif == False): - self.set_date_taken(datetime.fromtimestamp(seconds_since_epoch)) - return time.gmtime(seconds_since_epoch) """ @@ -322,7 +318,10 @@ class Video(Media): # Copy file information from original source to temporary file before copying back over shutil.copystat(source, temp_movie) + stat = os.stat(source) shutil.move(temp_movie, source) + os.utime(source, (stat.st_atime, stat.st_mtime)) + return True """