aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2013-07-15 17:23:36 +0100
committerStruan Donald <struan@exo.org.uk>2013-07-15 17:23:36 +0100
commitc703a5466e7c45c8edcb9b7ed4cdf605e5fa4dcb (patch)
tree4b16b77314aab7a1580dd24ee6e6485c2d230f9c
parent8ca8662ced7cca6b4c30e38f06a5b85a1528551e (diff)
do not try and move photos if the files are the same
-rw-r--r--src/js/files.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/js/files.js b/src/js/files.js
index b8aed05..a3a6458 100644
--- a/src/js/files.js
+++ b/src/js/files.js
@@ -109,7 +109,15 @@
var move = $.Deferred();
- src.moveTo( dest, null, move.resolve, move.reject);
+ var destPath = dest.fullPath + '/' + src.name;
+ var srcPath = src.fullPath + '';
+ if ( srcPath === destPath ) {
+ console.log('not moving because files are the same');
+ move.resolve( src );
+ } else {
+ console.log('paths differ so moving');
+ src.moveTo( dest, null, move.resolve, move.reject);
+ }
return move.promise();
}