Don't prefix root for images

This commit is contained in:
Jason A. Donenfeld 2015-01-27 14:25:06 +01:00
parent 61aabc7ee2
commit 8956a6c9a5

View File

@ -137,12 +137,15 @@
return PhotoFloat.cachePath(album.parent.path + "/" + album.path); return PhotoFloat.cachePath(album.parent.path + "/" + album.path);
}; };
PhotoFloat.photoPath = function(album, photo, size, square) { PhotoFloat.photoPath = function(album, photo, size, square) {
var suffix; var suffix, hash;
if (square) if (square)
suffix = size.toString() + "s"; suffix = size.toString() + "s";
else else
suffix = size.toString(); suffix = size.toString();
return "cache/" + PhotoFloat.cachePath(PhotoFloat.photoHash(album, photo) + "_" + suffix + ".jpg"); hash = PhotoFloat.cachePath(PhotoFloat.photoHash(album, photo) + "_" + suffix + ".jpg");
if (hash.indexOf("root-") === 0)
hash = hash.substring(5);
return "cache/" + hash;
}; };
PhotoFloat.originalPhotoPath = function(album, photo) { PhotoFloat.originalPhotoPath = function(album, photo) {
return "albums/" + album.path + "/" + photo.name; return "albums/" + album.path + "/" + photo.name;