Merge pull request #38 from nuttylmao/beta

Beta
This commit is contained in:
nutty
2026-11-02 17:47:03 +11:00
committed by GitHub
5 changed files with 21 additions and 42 deletions
@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><!-- Icon from Google Material Icons by Material Design Authors - https://github.com/material-icons/material-icons/blob/master/LICENSE --><path fill="#FFFFFF" d="M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2M5 19V5h6v14zm14 0h-6v-7h6zm0-9h-6V5h6z"/></svg>

After

Width:  |  Height:  |  Size: 368 B

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24"><!-- Icon from Material Symbols by Google - https://github.com/google/material-design-icons/blob/master/LICENSE --><path fill="#FFFFFF" d="M5 21q-.825 0-1.412-.587T3 19V5q0-.825.588-1.412T5 3h8.925l-2 2H5v14h14v-6.95l2-2V19q0 .825-.587 1.413T19 21zm4-6v-4.25l9.175-9.175q.3-.3.675-.45t.75-.15q.4 0 .763.15t.662.45L22.425 3q.275.3.425.663T23 4.4t-.137.738t-.438.662L13.25 15zM21.025 4.4l-1.4-1.4zM11 13h1.4l5.8-5.8l-.7-.7l-.725-.7L11 11.575zm6.5-6.5l-.725-.7zl.7.7z"/></svg>

After

Width:  |  Height:  |  Size: 556 B

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 14 14"><!-- Icon from Streamline by Streamline - https://creativecommons.org/licenses/by/4.0/ --><path fill="#FFFFFF" fill-rule="evenodd" d="M2.676.02a1.74 1.74 0 0 0-.845.218a1.64 1.64 0 0 0-.895 1.433v10.677a1.64 1.64 0 0 0 .895 1.433a1.74 1.74 0 0 0 1.718-.016l8.63-5.338a1.61 1.61 0 0 0-.001-2.876L3.548.253L3.532.244A1.74 1.74 0 0 0 2.676.02" clip-rule="evenodd"/></svg>

After

Width:  |  Height:  |  Size: 451 B

@@ -10,7 +10,7 @@
<!-- Update All Button --> <!-- Update All Button -->
<button onclick="OpenUpdateAllDialog()"> <button onclick="OpenUpdateAllDialog()">
<img src="https://api.iconify.design/material-symbols:edit-square-outline.svg?color=%23ffffff"> Update All <img src="icons/buttons/MaterialSymbolsEditSquareOutline.svg"> Update All
</button> </button>
<div style="display: flex; flex-direction: column; gap: 0.5em;"> <div style="display: flex; flex-direction: column; gap: 0.5em;">
@@ -32,7 +32,7 @@
<div id="broadcast-buttons"> <div id="broadcast-buttons">
<button id="broadcast-dashboard-button" class="icon-button" title="Dashboard"><img class="button-icon" <button id="broadcast-dashboard-button" class="icon-button" title="Dashboard"><img class="button-icon"
src="https://api.iconify.design/gridicons:popout.svg?color=%23ffffff"></button> src="icons/buttons/IcOutlineSpaceDashboard.svg"></button>
</div> </div>
</div> </div>
</div> </div>
@@ -230,9 +230,9 @@
<div id="broadcast-buttons"> <div id="broadcast-buttons">
<button id="broadcast-stream-button" class="icon-button" title="Open Stream"><img class="button-icon" <button id="broadcast-stream-button" class="icon-button" title="Open Stream"><img class="button-icon"
src="https://api.iconify.design/streamline:button-play-solid.svg?color=%23ffffff"></button> src="icons/buttons/StreamlineButtonPlaySolid.svg"></button>
<button id="broadcast-dashboard-button" class="icon-button" title="Dashboard"><img class="button-icon" <button id="broadcast-dashboard-button" class="icon-button" title="Dashboard"><img class="button-icon"
src="https://api.iconify.design/gridicons:popout.svg?color=%23ffffff"></button> src="icons/buttons/IcOutlineSpaceDashboard.svg"></button>
<button id="broadcast-edit-button" class="icon-button flip-that-shit-homie" title="Edit">✎</button> <button id="broadcast-edit-button" class="icon-button flip-that-shit-homie" title="Edit">✎</button>
</div> </div>
</div> </div>
+14 -38
View File
@@ -144,29 +144,6 @@ async function FetchBroadcasts() {
runningActionId = response.args.runningActionId; runningActionId = response.args.runningActionId;
} }
async function FetchKickInfo() {
// Fetch from Streamer.bot
const broadcasterInfo = await window.parent.sbClient.getBroadcaster();
if (broadcasterInfo.platforms.kick) {
const userLogin = broadcasterInfo.platforms.kick.broadcasterLogin;
let kickData = {
platform: 'kick',
id: 'kick',
streamUrl: `https://www.kick.com/${userLogin.replaceAll('_', '-')}`,
dashboardUrl: 'https://dashboard.kick.com/stream',
userLogin: userLogin
}
AddBroadcast(kickData);
}
else {
const kickBroadcastDiv = document.getElementById('id-kick');
if (kickBroadcastDiv)
kickBroadcastDiv.remove();
}
}
async function AddBroadcast(data) { async function AddBroadcast(data) {
// Get a reference to the template // Get a reference to the template
const template = document.getElementById('broadcast-template'); const template = document.getElementById('broadcast-template');
@@ -197,16 +174,24 @@ async function AddBroadcast(data) {
if (data.platform == 'kick') if (data.platform == 'kick')
{ {
let response = await fetch('https://kick.com/api/v1/channels/' + data.userLogin); let response = await fetch('https://kick.com/api/v1/channels/' + data.userLogin);
let response_data = await response.json();
// Try alternate slug if the original returns an HTTP error
// The current title is only provided if the stream if currently live if (!response.ok && data.userLogin.includes('_'))
if (response_data.livestream) {
let slug = data.userLogin.replace(/_/g, '-');
response = await fetch('https://kick.com/api/v1/channels/' + slug);
}
let response_data = response.ok ? await response.json() : null;
// The current title is only provided if the stream is currently live
if (response_data?.livestream)
{ {
data.title = response_data.livestream.session_title; data.title = response_data.livestream.session_title;
data.category = response_data.livestream.categories[0].name; data.category = response_data.livestream.categories[0].name;
kickWarningEl.style.display = 'none'; kickWarningEl.style.display = 'none';
} }
else if (response_data.previous_livestreams.length > 0) else if (response_data?.previous_livestreams?.length > 0)
{ {
data.title = response_data.previous_livestreams[0].session_title; data.title = response_data.previous_livestreams[0].session_title;
data.category = response_data.previous_livestreams[0].categories[0].name; data.category = response_data.previous_livestreams[0].categories[0].name;
@@ -614,13 +599,4 @@ youtubeTagsInput.addEventListener("input", ValidateYouTubeDialog);
ValidateUpdateAllDialog(); ValidateUpdateAllDialog();
ValidateTwitchDialog(); ValidateTwitchDialog();
ValidateKickDialog(); ValidateKickDialog();
ValidateYouTubeDialog(); ValidateYouTubeDialog();
////////////////////////////
// REFRESH BROADCAST LIST //
////////////////////////////
setInterval(FetchKickInfo, 5000);