Compare commits
No commits in common. "1b87a2611ee3b5404b8759a484b06a1222f9f79f" and "f564567897f60885048cb11e3e06020eafe8afdf" have entirely different histories.
1b87a2611e
...
f564567897
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "twitch-vod-manager",
|
||||
"version": "4.6.19",
|
||||
"version": "4.6.18",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "twitch-vod-manager",
|
||||
"version": "4.6.19",
|
||||
"version": "4.6.18",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"axios": "^1.6.0",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "twitch-vod-manager",
|
||||
"version": "4.6.19",
|
||||
"version": "4.6.18",
|
||||
"description": "Twitch VOD Manager - Download Twitch VODs easily",
|
||||
"main": "dist/main.js",
|
||||
"author": "xRangerDE",
|
||||
|
||||
18
src/main.ts
18
src/main.ts
@ -2393,7 +2393,7 @@ interface PublicProfileQueryResult {
|
||||
displayName: string;
|
||||
description: string | null;
|
||||
profileImageURL: string | null;
|
||||
roles?: { isPartner: boolean; isAffiliate: boolean } | null;
|
||||
broadcasterType: string | null;
|
||||
followers?: { totalCount: number } | null;
|
||||
} | null;
|
||||
}
|
||||
@ -2405,13 +2405,6 @@ async function fetchPublicStreamerProfile(login: string): Promise<{
|
||||
broadcasterType: '' | 'partner' | 'affiliate';
|
||||
followerCount: number | 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>(
|
||||
`query($login: String!) {
|
||||
user(login: $login) {
|
||||
@ -2420,22 +2413,19 @@ async function fetchPublicStreamerProfile(login: string): Promise<{
|
||||
displayName
|
||||
description
|
||||
profileImageURL(width: 150)
|
||||
roles { isPartner isAffiliate }
|
||||
broadcasterType
|
||||
followers { totalCount }
|
||||
}
|
||||
}`,
|
||||
{ login }
|
||||
);
|
||||
if (!data?.user) return null;
|
||||
const roles = data.user.roles;
|
||||
const broadcasterType: '' | 'partner' | 'affiliate' = roles?.isPartner
|
||||
? 'partner'
|
||||
: (roles?.isAffiliate ? 'affiliate' : '');
|
||||
const bt = (data.user.broadcasterType || '').toLowerCase();
|
||||
return {
|
||||
displayName: data.user.displayName || login,
|
||||
avatarUrl: data.user.profileImageURL || '',
|
||||
description: data.user.description || '',
|
||||
broadcasterType,
|
||||
broadcasterType: (bt === 'partner' || bt === 'affiliate') ? bt : '',
|
||||
followerCount: typeof data.user.followers?.totalCount === 'number' ? data.user.followers.totalCount : null
|
||||
};
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user