abmp-npm 1.1.96 → 1.1.97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -138,21 +138,25 @@ async function updateMemberRichContent(memberId) {
|
|
|
138
138
|
async function updateMemberProfileImage(memberId) {
|
|
139
139
|
try {
|
|
140
140
|
const member = await findMemberByWixDataId(memberId);
|
|
141
|
-
|
|
141
|
+
const trimmedProfileImage = member.profileImage.trim();
|
|
142
142
|
// Check if member has an external profile image URL
|
|
143
|
-
if (
|
|
143
|
+
if (
|
|
144
|
+
!trimmedProfileImage ||
|
|
145
|
+
trimmedProfileImage.startsWith('wix:') ||
|
|
146
|
+
trimmedProfileImage.startsWith('https://static.wixstatic.com')
|
|
147
|
+
) {
|
|
144
148
|
console.log(`Member ${memberId} already has Wix-hosted image or no image`);
|
|
145
149
|
return { success: true, message: 'No update needed' };
|
|
146
150
|
}
|
|
147
151
|
|
|
148
152
|
// Validate image URL format before attempting download
|
|
149
|
-
if (!isValidImageUrl(
|
|
150
|
-
console.log(`Member ${memberId} has invalid image URL format: ${
|
|
153
|
+
if (!isValidImageUrl(trimmedProfileImage)) {
|
|
154
|
+
console.log(`Member ${memberId} has invalid image URL format: ${trimmedProfileImage}`);
|
|
151
155
|
return { success: true, message: 'Invalid image URL format - skipped' };
|
|
152
156
|
}
|
|
153
157
|
|
|
154
158
|
// Encode URL to handle spaces and special characters in the path
|
|
155
|
-
const encodedImageUrl = encodeURI(
|
|
159
|
+
const encodedImageUrl = encodeURI(trimmedProfileImage);
|
|
156
160
|
|
|
157
161
|
const response = await axios.get(encodedImageUrl, {
|
|
158
162
|
responseType: 'arraybuffer',
|