Fixed profile description not saving when user has avatar.

This commit is contained in:
DebaucheryLibrarian 2024-09-11 05:16:54 +02:00
parent 9f1248301b
commit 854d55618a
2 changed files with 9 additions and 10 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@ node_modules/
config/*.js
!config/default.js
output/
dist/

View File

@ -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) {