Skip to content

Commit

Permalink
Fix 7TV URL Debug Print
Browse files Browse the repository at this point in the history
  • Loading branch information
GreenComfyTea committed Nov 17, 2023
1 parent 4977d21 commit c6ffbc9
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ let Channel = {
Channel.info.duplicateEmotes[emote.name] = Channel.info.emotes[emote.name];
}

DEBUG && console.log(`[7TV${globalString}] ${emote.name}: ${url}`);
DEBUG && console.log(`[7TV${globalString}] ${emote.name}: ${new_emote.url}`);
});

DEBUG && console.log(`[7TV${globalString}] Done!`);
Expand Down Expand Up @@ -323,22 +323,17 @@ let Channel = {
},

load: async function() {
const channelID = await getJson(`https://decapi.me/twitch/id/${Channel.info.name}`);
if(channelID.includes("User not found")) {
loading.classList.add("hidden");
userNotFound.classList.remove("hidden");
return;
}

Channel.info.id = channelID;
DEBUG && console.log(Channel.info.name + ": " + channelID);
await Channel.initId();
await Channel.loadEmotes();

generateHtml();
},

init: function(channelName) {
Channel.info.name = channelName;
Channel.info.id = 0;
Channel.info.emotes = {};
Channel.info.duplicateEmotes = {};
document.title = channelName + " • Dup Emote Check Tool";
Channel.load();
}
Expand Down Expand Up @@ -393,7 +388,8 @@ function calculateDuplicateEmotes(event) {
if (event !== null) {
event.preventDefault();
}


checkButton.classList.add("disabled");
userNotFound.classList.add("hidden");
noEmoteDuplicates.classList.add("hidden");
result.classList.add("hidden");
Expand Down Expand Up @@ -511,6 +507,8 @@ function generateHtml() {
result.classList.remove("hidden");
}

checkButton.classList.remove("disabled");

DEBUG && console.log("All emotes: ");
DEBUG && console.log(Channel.info.emotes);
DEBUG && console.log("Duplicate emotes: ");
Expand All @@ -519,6 +517,7 @@ function generateHtml() {

const generator = document.getElementById("generator");
const channel = document.getElementById("channel");
const checkButton = document.getElementById("check_button");
const loading = document.getElementById("loading");
const userNotFound = document.getElementById("user-not-found");
const noEmoteDuplicates = document.getElementById("no-emote-duplicates");
Expand Down

0 comments on commit c6ffbc9

Please sign in to comment.