@xuda.io/account_module 1.2.1497 → 1.2.1499
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.
- package/index.mjs +8 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -1954,6 +1954,7 @@ setTimeout(async () => {
|
|
|
1954
1954
|
// ret = _design.views.ai_chat_usage;
|
|
1955
1955
|
// console.log(_design.views.ai_chat_usage);
|
|
1956
1956
|
// ret = await set_contact_profile_picture(uid, 'cnt_2d21d55f8f0cdaf65a7a69f69617f532', {}, null, {});
|
|
1957
|
+
ret = await get_picture_cache(uid, 'chat_thumbnail', 'word five title');
|
|
1957
1958
|
console.log(ret);
|
|
1958
1959
|
}, 1000);
|
|
1959
1960
|
|
|
@@ -3083,10 +3084,16 @@ export const get_picture_cache = async function (uid, docType, name) {
|
|
|
3083
3084
|
return result.map((arr) => arr.join(' '));
|
|
3084
3085
|
}
|
|
3085
3086
|
if (name.split(' ').length < 3) return;
|
|
3086
|
-
|
|
3087
|
+
let file;
|
|
3087
3088
|
const words_combinations_arr = findAnyThreeWords(name);
|
|
3088
3089
|
for await (const phrase of words_combinations_arr) {
|
|
3089
3090
|
const words_arr = phrase.split(' ');
|
|
3090
3091
|
opt.selector = { docType, $and: [{ name: { $regex: `(?i)\\b${words_arr[0]}}\\b` } }, { name: { $regex: `(?i)\\b${words_arr[1]}\\b` } }, { name: { $regex: `(?i)\\b${words_arr[2]}\\b` } }] };
|
|
3092
|
+
const ret = await db_module.find_couch_query('xuda_cache', opt);
|
|
3093
|
+
if (ret.doc.length) {
|
|
3094
|
+
file = ret.doc[0].file;
|
|
3095
|
+
break;
|
|
3096
|
+
}
|
|
3091
3097
|
}
|
|
3098
|
+
return file;
|
|
3092
3099
|
};
|