Skip to content

Commit

Permalink
Merge 02468c2 into ffb26fb
Browse files Browse the repository at this point in the history
  • Loading branch information
jmathai committed Dec 2, 2018
2 parents ffb26fb + 02468c2 commit 899f4e6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion elodie.py
Expand Up @@ -46,7 +46,7 @@ def import_file(_file, destination, album_from_folder, trash, allow_duplicates):
(_file, _file))
return
# Check if the source, _file, is a child folder within destination
elif destination.startswith(os.path.dirname(_file)):
elif destination.startswith(os.path.abspath(os.path.dirname(_file))+os.sep):
print('{"source": "%s", "destination": "%s", "error_msg": "Source cannot be in destination"}' % (_file, destination))
return

Expand Down
4 changes: 2 additions & 2 deletions elodie/tests/elodie_test.py
Expand Up @@ -240,8 +240,8 @@ def test_import_destination_in_source():
folder_destination = '{}/destination'.format(folder)
os.mkdir(folder_destination)

origin = '%s/video.mov' % folder
shutil.copyfile(helper.get_file('video.mov'), origin)
origin = '%s/plain.jpg' % folder
shutil.copyfile(helper.get_file('plain.jpg'), origin)

helper.reset_dbs()
dest_path = elodie.import_file(origin, folder_destination, False, False, False)
Expand Down

0 comments on commit 899f4e6

Please sign in to comment.