Compare commits
No commits in common. "master" and "dev" have entirely different histories.
6 changed files with 54 additions and 2052 deletions
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
npx lint-staged --no-stash
|
||||
npx lint-staged
|
||||
|
|
2077
package-lock.json
generated
2077
package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -21,7 +21,7 @@
|
|||
"fs-extra": "^11.1.0",
|
||||
"gray-matter": "^4.0.3",
|
||||
"ioredis": "^5.2.5",
|
||||
"mongodb": "^4.1.1",
|
||||
"mongodb": "^5.1.0",
|
||||
"next": "13.0.4",
|
||||
"next-auth": "^4.20.1",
|
||||
"react": "18.2.0",
|
||||
|
|
|
@ -54,10 +54,8 @@ export default async function handler(
|
|||
channel: (await getBTTVUser(redis, "56418014")).channelEmotes,
|
||||
},
|
||||
ffz: {
|
||||
// concat all emoticons in the ffzGlobal.sets json keys
|
||||
global: Object.values(ffzGlobal.sets).reduce(
|
||||
(acc: any, cur: any) => acc.concat(cur.emoticons),
|
||||
[]
|
||||
global: ffzGlobal.sets["3"].emoticons.concat(
|
||||
ffzGlobal.sets["4330"].emoticons
|
||||
),
|
||||
channel: (await getFFZEmoteSet(redis, "341402")).set.emoticons,
|
||||
},
|
||||
|
|
|
@ -21,14 +21,17 @@ function Home() {
|
|||
let base_url = emote.data.host.url;
|
||||
// get the largest emote size, append it to the base url
|
||||
let largest = emote.data.host.files[emote.data.host.files.length - 1];
|
||||
// could be null
|
||||
if (!largest || largest.width !== largest.height) {
|
||||
return false;
|
||||
// if width != height, skip it
|
||||
if (largest.width !== largest.height) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return `https:${base_url}/${largest.name}`;
|
||||
});
|
||||
|
||||
// remove null values
|
||||
|
||||
emoteUrls = emoteUrls.filter((emote: any) => emote !== null);
|
||||
|
||||
setEmotes(emoteUrls);
|
||||
setCurrentEmote(Math.floor(Math.random() * emoteUrls.length));
|
||||
});
|
||||
|
|
|
@ -55,10 +55,6 @@ function UserPage(props: UserPageProps) {
|
|||
let base_url = emote.data.host.url;
|
||||
// get the largest emote size, append it to the base url
|
||||
let largest = emote.data.host.files[emote.data.host.files.length - 1];
|
||||
// if null return
|
||||
if (!largest) {
|
||||
return false;
|
||||
}
|
||||
emotes["7tv"][emote.data.name] = `https:${base_url}/${largest.name}`;
|
||||
});
|
||||
// same for global emotes
|
||||
|
@ -81,14 +77,14 @@ function UserPage(props: UserPageProps) {
|
|||
// ffz
|
||||
data["ffz"].channel.forEach((emote: any) => {
|
||||
// ffz emotes don't have all sizes available, so we need to get the largest one by taking the largest key in the urls object
|
||||
emotes["ffz"][emote.name] = `${
|
||||
emotes["ffz"][emote.name] = `https:${
|
||||
emote.urls[
|
||||
Math.max(...Object.keys(emote.urls).map((k) => parseInt(k)))
|
||||
]
|
||||
}`;
|
||||
});
|
||||
data["ffz"].global.forEach((emote: any) => {
|
||||
emotes["ffz"][emote.name] = `${
|
||||
emotes["ffz"][emote.name] = `https:${
|
||||
emote.urls[
|
||||
Math.max(...Object.keys(emote.urls).map((k) => parseInt(k)))
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue