Compare commits
9 Commits
4b90a5feec
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 1374f90397 | |||
| 33733720c5 | |||
| ec4b15ce33 | |||
| 3f6f3ed038 | |||
| ee23dc0358 | |||
| b2305966ed | |||
| 0c9917fc27 | |||
| fda6f5cb93 | |||
| c45852d693 |
27
actors.mjs
27
actors.mjs
@@ -164,14 +164,14 @@ export async function interpolateProfiles(actorIdsOrNames, context, options = {}
|
|||||||
|
|
||||||
profile.avatar_media_id = actorProfiles
|
profile.avatar_media_id = actorProfiles
|
||||||
.map((actorProfile) => actorProfile.avatar)
|
.map((actorProfile) => actorProfile.avatar)
|
||||||
.filter((avatar) => avatar && (avatar.entropy === null || avatar.entropy > 5.5))
|
.filter((avatar) => avatar && (avatar.entropy === null || avatar.entropy > 5.5) && !options.avoidAvatarCredits?.includes(avatar.credit) && !options.excludeAvatarCredits?.includes(avatar.credit))
|
||||||
.sort((avatarA, avatarB) => avatarB.height - avatarA.height)[0]?.id || null;
|
.sort((avatarA, avatarB) => avatarB.height - avatarA.height)[0]?.id || null;
|
||||||
|
|
||||||
if (!profile.avatar_media_id) {
|
if (!profile.avatar_media_id) {
|
||||||
// try to settle for low quality avatar
|
// try to settle for low quality avatar
|
||||||
profile.avatar_media_id = actorProfiles
|
profile.avatar_media_id = actorProfiles
|
||||||
.map((actorProfile) => actorProfile.avatar)
|
.map((actorProfile) => actorProfile.avatar)
|
||||||
.filter((avatar) => avatar)
|
.filter((avatar) => !!avatar && !options?.excludeAvatarCredits?.includes(avatar.credit))
|
||||||
.sort((avatarA, avatarB) => avatarB.height - avatarA.height)[0]?.id || null;
|
.sort((avatarA, avatarB) => avatarB.height - avatarA.height)[0]?.id || null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -243,12 +243,19 @@ export const socials = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
export const platformsByHostname = Object.fromEntries(Object.entries(socials.urls).map(([platform, url]) => {
|
export const platformsByHostname = {
|
||||||
const { hostname, pathname } = new URL(url);
|
...Object.fromEntries(Object.entries(socials.urls).map(([platform, url]) => {
|
||||||
|
const { hostname, pathname } = new URL(url);
|
||||||
|
|
||||||
return [hostname, {
|
return [hostname, {
|
||||||
platform,
|
platform,
|
||||||
pathname: decodeURIComponent(pathname),
|
pathname: decodeURIComponent(pathname),
|
||||||
url,
|
url,
|
||||||
}];
|
}];
|
||||||
}));
|
})),
|
||||||
|
'twitter.com': {
|
||||||
|
platform: 'twitter',
|
||||||
|
pathname: '/{handle}',
|
||||||
|
url: 'https://twitter.com/{handle}',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|||||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "traxxx-utils",
|
"name": "traxxx-utils",
|
||||||
"version": "1.2.10",
|
"version": "1.3.3",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "traxxx-utils",
|
"name": "traxxx-utils",
|
||||||
"version": "1.2.10",
|
"version": "1.3.3",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/cli": "^7.25.7",
|
"@babel/cli": "^7.25.7",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "traxxx-common",
|
"name": "traxxx-common",
|
||||||
"version": "1.2.10",
|
"version": "1.3.3",
|
||||||
"description": "Common utilities for traxxx core and web.",
|
"description": "Common utilities for traxxx core and web.",
|
||||||
"main": "src/app.js",
|
"main": "src/app.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user