Compare commits

..

No commits in common. "1b87a2611ee3b5404b8759a484b06a1222f9f79f" and "f564567897f60885048cb11e3e06020eafe8afdf" have entirely different histories.

3 changed files with 7 additions and 17 deletions

4
package-lock.json generated
View File

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

View File

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

View File

@ -2393,7 +2393,7 @@ interface PublicProfileQueryResult {
displayName: string; displayName: string;
description: string | null; description: string | null;
profileImageURL: string | null; profileImageURL: string | null;
roles?: { isPartner: boolean; isAffiliate: boolean } | null; broadcasterType: string | null;
followers?: { totalCount: number } | null; followers?: { totalCount: number } | null;
} | null; } | null;
} }
@ -2405,13 +2405,6 @@ async function fetchPublicStreamerProfile(login: string): Promise<{
broadcasterType: '' | 'partner' | 'affiliate'; broadcasterType: '' | 'partner' | 'affiliate';
followerCount: number | null; followerCount: number | null;
} | null> { } | null> {
// The public (unauthenticated) GQL schema does NOT expose
// `broadcasterType` directly — querying it returns an errors[] response
// which the upstream helper treats as a complete failure (null data),
// which in turn left the avatar empty and the user's whole profile
// fell through to the fallback letter tile. Use `roles{isPartner
// isAffiliate}` instead, which the public schema does expose, and
// derive broadcasterType locally.
const data = await fetchPublicTwitchGql<PublicProfileQueryResult>( const data = await fetchPublicTwitchGql<PublicProfileQueryResult>(
`query($login: String!) { `query($login: String!) {
user(login: $login) { user(login: $login) {
@ -2420,22 +2413,19 @@ async function fetchPublicStreamerProfile(login: string): Promise<{
displayName displayName
description description
profileImageURL(width: 150) profileImageURL(width: 150)
roles { isPartner isAffiliate } broadcasterType
followers { totalCount } followers { totalCount }
} }
}`, }`,
{ login } { login }
); );
if (!data?.user) return null; if (!data?.user) return null;
const roles = data.user.roles; const bt = (data.user.broadcasterType || '').toLowerCase();
const broadcasterType: '' | 'partner' | 'affiliate' = roles?.isPartner
? 'partner'
: (roles?.isAffiliate ? 'affiliate' : '');
return { return {
displayName: data.user.displayName || login, displayName: data.user.displayName || login,
avatarUrl: data.user.profileImageURL || '', avatarUrl: data.user.profileImageURL || '',
description: data.user.description || '', description: data.user.description || '',
broadcasterType, broadcasterType: (bt === 'partner' || bt === 'affiliate') ? bt : '',
followerCount: typeof data.user.followers?.totalCount === 'number' ? data.user.followers.totalCount : null followerCount: typeof data.user.followers?.totalCount === 'number' ? data.user.followers.totalCount : null
}; };
} }