Compare commits

...
Sign in to create a new pull request.

11 commits
dev ... master

Author SHA1 Message Date
zach
b1829d7156
Merge pull request from Invest-Bot/hotfix/null-handle
Hotfix: Lack of null emote URL checks
2023-04-21 10:11:19 -07:00
3zachm
f6191b2efe fix lack of null emote URL checks 2023-04-21 10:08:32 -07:00
3zachm
598ebc4ed2 fix package-lock mismatch 2023-03-31 11:16:47 -07:00
zach
438b641937
Merge pull request from Invest-Bot/dephotfix
Fix mongodb adapter versioning conflict
2023-03-29 21:49:29 -07:00
3zachm
f7ce4b18ad fix dep conflict 2023-03-29 21:47:29 -07:00
zach
2d0c025583
Merge pull request from Invest-Bot/dev
init auth
2023-03-29 21:31:02 -07:00
3zachm
0e3e9c1b24 ffz no longer needs https appended 2023-03-09 17:29:05 -08:00
3zachm
d9e16f0a2f modularize ffz emote url list (ID change unpredictable) 2023-03-09 17:16:12 -08:00
3zachm
c959726bf1 didn't follow my own readme... 2023-02-09 01:48:27 -08:00
3zachm
065d91dee2 sync wiki to web: new lang ex 2023-02-09 01:43:21 -08:00
zach
44b1405979
Merge pull request from Invest-Bot/dev
Merge Dev: Wiki Implemented
2023-02-09 01:27:58 -08:00
6 changed files with 2052 additions and 54 deletions

View file

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

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",
"gray-matter": "^4.0.3",
"ioredis": "^5.2.5",
"mongodb": "^5.1.0",
"mongodb": "^4.1.1",
"next": "13.0.4",
"next-auth": "^4.20.1",
"react": "18.2.0",

View file

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

View file

@ -21,17 +21,14 @@ 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];
// if width != height, skip it
if (largest.width !== largest.height) {
return null;
// could be null
if (!largest || largest.width !== largest.height) {
return false;
}
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));
});

View file

@ -55,6 +55,10 @@ 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
@ -77,14 +81,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] = `https:${
emotes["ffz"][emote.name] = `${
emote.urls[
Math.max(...Object.keys(emote.urls).map((k) => parseInt(k)))
]
}`;
});
data["ffz"].global.forEach((emote: any) => {
emotes["ffz"][emote.name] = `https:${
emotes["ffz"][emote.name] = `${
emote.urls[
Math.max(...Object.keys(emote.urls).map((k) => parseInt(k)))
]