From f00d8b8744104c84e3c5fae82be51b13f25db840 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Dr=C3=A4s?= Date: Fri, 21 Oct 2016 22:01:31 +0200 Subject: [PATCH] gh-139 added change requests --- elodie/filesystem.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/elodie/filesystem.py b/elodie/filesystem.py index 69c306f..9bd590a 100644 --- a/elodie/filesystem.py +++ b/elodie/filesystem.py @@ -15,10 +15,6 @@ from elodie import geolocation from elodie import constants from elodie.localstorage import Db from elodie.media.media import Media -from elodie.media.text import Text -from elodie.media.audio import Audio -from elodie.media.photo import Photo -from elodie.media.video import Video class FileSystem(object): @@ -218,6 +214,8 @@ class FileSystem(object): shutil.move(_file, dest_path) os.utime(dest_path, (stat.st_atime, stat.st_mtime)) else: + # Do not use copy2(), will have an issue when copying to a network/mounted drive + # using copy and manual set_date_from_filename gets the job done shutil.copy(_file, dest_path) self.set_date_from_filename(dest_path) @@ -234,7 +232,7 @@ class FileSystem(object): file_name = os.path.basename(file) # Initialize date taken to what's returned from the metadata function. # If the folder and file name follow a time format of - # YYYY-MM/DD-IMG_0001.JPG then we override the date_taken + # YYYY-MM-DD_HH-MM-SS-IMG_0001.JPG then we override the date_taken (year, month, day, hour, minute, second) = [None] * 6 year_month_day_match = re.search('(\d{4})-(\d{2})-(\d{2})_(\d{2})-(\d{2})-(\d{2})', file_name) if(year_month_day_match is not None):