Fixed profile description not saving when user has avatar.
This commit is contained in:
parent
9f1248301b
commit
854d55618a
|
@ -2,3 +2,4 @@ node_modules/
|
|||
config/*.js
|
||||
!config/default.js
|
||||
output/
|
||||
dist/
|
||||
|
|
|
@ -14,18 +14,16 @@ function saveProfileDetails(user) {
|
|||
|
||||
if(config.library.profile.avoidAvatar && new urlPattern('http(s)\\://(www.)redditstatic.com/avatars/:id(.:ext)(?:query)').match(image)) {
|
||||
console.log('\x1b[33m%s\x1b[0m', `Ignoring standard avatar profile image for '${user.name}'`);
|
||||
} else {
|
||||
const filepath = interpolate(config.library.profile.image, user, null, {
|
||||
// pass profile image as item to interpolate extension variable
|
||||
url: image
|
||||
});
|
||||
|
||||
return user;
|
||||
fetchItem(image).then(stream => save(filepath, stream)).catch(error => {
|
||||
console.log('\x1b[33m%s\x1b[0m', `Could not save profile image for '${user.name}': ${error}`);
|
||||
});
|
||||
}
|
||||
|
||||
const filepath = interpolate(config.library.profile.image, user, null, {
|
||||
// pass profile image as item to interpolate extension variable
|
||||
url: image
|
||||
});
|
||||
|
||||
fetchItem(image).then(stream => save(filepath, stream)).catch(error => {
|
||||
console.log('\x1b[33m%s\x1b[0m', `Could not save profile image for '${user.name}': ${error}`);
|
||||
});
|
||||
}
|
||||
|
||||
if(config.library.profile.description) {
|
||||
|
|
Loading…
Reference in New Issue