mirror of
https://github.com/azures04/crafatar.git
synced 2026-05-06 19:10:38 +02:00
Add more tests
This commit is contained in:
@@ -94,13 +94,6 @@ function store_cape(uuid, profile, details, callback) {
|
||||
});
|
||||
}
|
||||
|
||||
function remove_from_array(arr, item) {
|
||||
var i;
|
||||
while((i = arr.indexOf(item)) !== -1) {
|
||||
arr.splice(i, 1);
|
||||
}
|
||||
}
|
||||
|
||||
// downloads the images for +uuid+ while checking the cache
|
||||
// status based on +details+. +whichhash+ specifies which
|
||||
// image is more important, and should be called back on
|
||||
@@ -208,7 +201,7 @@ exp.get_avatar = function(uuid, helm, size, callback) {
|
||||
var facepath = __dirname + "/../" + config.faces_dir + hash + ".png";
|
||||
var helmpath = __dirname + "/../" + config.helms_dir + hash + ".png";
|
||||
var filepath = facepath;
|
||||
fs.exists(helmpath, function (exists) {
|
||||
fs.exists(helmpath, function(exists) {
|
||||
if (helm && exists) {
|
||||
filepath = helmpath;
|
||||
}
|
||||
|
||||
@@ -62,10 +62,10 @@ exp.extract_helm = function(uuid, facefile, buffer, outname, callback) {
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// resizes the image file +inname+ to +size+ by +size+ pixels
|
||||
@@ -99,8 +99,10 @@ exp.open_skin = function(uuid, skinpath, callback) {
|
||||
fs.readFile(skinpath, function(err, buf) {
|
||||
if (err) {
|
||||
logging.error(uuid + " error while opening skin file: " + err);
|
||||
callback(err, null)
|
||||
} else {
|
||||
callback(null, buf);
|
||||
}
|
||||
callback(err, buf);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user