Compare commits

..

No commits in common. "5200126565a77dc8a947bff248288dcf64b81292" and "2f918231610345201d77ba5b67da5c69c294f46a" have entirely different histories.

3 changed files with 16 additions and 16 deletions

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "twitch-vod-manager",
"version": "4.6.30",
"version": "4.6.29",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "twitch-vod-manager",
"version": "4.6.30",
"version": "4.6.29",
"license": "MIT",
"dependencies": {
"axios": "^1.6.0",

View File

@ -1,6 +1,6 @@
{
"name": "twitch-vod-manager",
"version": "4.6.30",
"version": "4.6.29",
"description": "Twitch VOD Manager - Download Twitch VODs easily",
"main": "dist/main.js",
"author": "xRangerDE",

View File

@ -2410,24 +2410,15 @@ interface PublicProfileQueryResult {
} | null;
}
interface PublicStreamerProfileResult {
async function fetchPublicStreamerProfile(login: string): Promise<{
displayName: string;
avatarUrl: string;
bannerUrl: string;
description: string;
broadcasterType: '' | 'partner' | 'affiliate';
followerCount: number | null;
stream: PublicStreamInfo | null;
}
interface PublicStreamInfo {
previewUrl: string;
viewers: number | null;
title: string | null;
game: string | null;
}
async function fetchPublicStreamerProfile(login: string): Promise<PublicStreamerProfileResult | null> {
stream: { previewUrl: string; viewers: number | null; title: string | null; game: string | null } | null;
} | null> {
// Same query also pulls bannerImageURL and the current stream's
// preview + viewer count when live — saves a separate roundtrip.
const data = await fetchPublicTwitchGql<PublicProfileQueryResult>(
@ -2476,6 +2467,15 @@ async function fetchPublicStreamerProfile(login: string): Promise<PublicStreamer
};
}
async function fetchOnlyFollowerCount(login: string): Promise<number | null> {
const data = await fetchPublicTwitchGql<PublicProfileQueryResult>(
`query($login: String!) { user(login: $login) { followers { totalCount } } }`,
{ login }
);
const cnt = data?.user?.followers?.totalCount;
return typeof cnt === 'number' ? cnt : null;
}
async function getStreamerProfile(login: string, forceRefresh = false): Promise<StreamerProfile | null> {
const normalized = normalizeLogin(login);
if (!normalized) return null;
@ -2502,7 +2502,7 @@ async function getStreamerProfile(login: string, forceRefresh = false): Promise<
let bannerUrl = '';
let description = '';
let broadcasterType: '' | 'partner' | 'affiliate' = '';
let streamFromPublic: PublicStreamInfo | null = null;
let streamFromPublic: Awaited<ReturnType<typeof fetchPublicStreamerProfile>> extends infer R ? (R extends null ? null : R extends { stream: infer S } ? S : null) : null = null;
let followerCountFromPublic: number | null = null;
const publicProfile = await fetchPublicStreamerProfile(normalized);