Compare commits

..

No commits in common. "master" and "dev" have entirely different histories.
master ... dev

6 changed files with 54 additions and 2052 deletions

View file

@ -1,4 +1,4 @@
#!/usr/bin/env sh #!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh" . "$(dirname -- "$0")/_/husky.sh"
npx lint-staged --no-stash npx lint-staged

2077
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -21,7 +21,7 @@
"fs-extra": "^11.1.0", "fs-extra": "^11.1.0",
"gray-matter": "^4.0.3", "gray-matter": "^4.0.3",
"ioredis": "^5.2.5", "ioredis": "^5.2.5",
"mongodb": "^4.1.1", "mongodb": "^5.1.0",
"next": "13.0.4", "next": "13.0.4",
"next-auth": "^4.20.1", "next-auth": "^4.20.1",
"react": "18.2.0", "react": "18.2.0",

View file

@ -54,10 +54,8 @@ export default async function handler(
channel: (await getBTTVUser(redis, "56418014")).channelEmotes, channel: (await getBTTVUser(redis, "56418014")).channelEmotes,
}, },
ffz: { ffz: {
// concat all emoticons in the ffzGlobal.sets json keys global: ffzGlobal.sets["3"].emoticons.concat(
global: Object.values(ffzGlobal.sets).reduce( ffzGlobal.sets["4330"].emoticons
(acc: any, cur: any) => acc.concat(cur.emoticons),
[]
), ),
channel: (await getFFZEmoteSet(redis, "341402")).set.emoticons, channel: (await getFFZEmoteSet(redis, "341402")).set.emoticons,
}, },

View file

@ -21,14 +21,17 @@ function Home() {
let base_url = emote.data.host.url; let base_url = emote.data.host.url;
// get the largest emote size, append it to the base url // get the largest emote size, append it to the base url
let largest = emote.data.host.files[emote.data.host.files.length - 1]; let largest = emote.data.host.files[emote.data.host.files.length - 1];
// could be null // if width != height, skip it
if (!largest || largest.width !== largest.height) { if (largest.width !== largest.height) {
return false; return null;
} }
return `https:${base_url}/${largest.name}`; return `https:${base_url}/${largest.name}`;
}); });
// remove null values
emoteUrls = emoteUrls.filter((emote: any) => emote !== null);
setEmotes(emoteUrls); setEmotes(emoteUrls);
setCurrentEmote(Math.floor(Math.random() * emoteUrls.length)); setCurrentEmote(Math.floor(Math.random() * emoteUrls.length));
}); });

View file

@ -55,10 +55,6 @@ function UserPage(props: UserPageProps) {
let base_url = emote.data.host.url; let base_url = emote.data.host.url;
// get the largest emote size, append it to the base url // get the largest emote size, append it to the base url
let largest = emote.data.host.files[emote.data.host.files.length - 1]; 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}`; emotes["7tv"][emote.data.name] = `https:${base_url}/${largest.name}`;
}); });
// same for global emotes // same for global emotes
@ -81,14 +77,14 @@ function UserPage(props: UserPageProps) {
// ffz // ffz
data["ffz"].channel.forEach((emote: any) => { 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 // 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[ emote.urls[
Math.max(...Object.keys(emote.urls).map((k) => parseInt(k))) Math.max(...Object.keys(emote.urls).map((k) => parseInt(k)))
] ]
}`; }`;
}); });
data["ffz"].global.forEach((emote: any) => { data["ffz"].global.forEach((emote: any) => {
emotes["ffz"][emote.name] = `${ emotes["ffz"][emote.name] = `https:${
emote.urls[ emote.urls[
Math.max(...Object.keys(emote.urls).map((k) => parseInt(k))) Math.max(...Object.keys(emote.urls).map((k) => parseInt(k)))
] ]