Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getTeam.ts: fix for teams with no logo #806

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/endpoints/getTeam.ts

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please merge this proposed change. I am also having issues with getting data against some team ids.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This package is not maintained anymore, I suggest forking/patching it with whatever changes you need for your project.

Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const getTeam =

const name = $('.profile-team-name').text()
const logoSrc = $('.teamlogo').attr('src')
const logo = logoSrc.includes('placeholder.svg') ? undefined : logoSrc
const logo = logoSrc?.includes('placeholder.svg') ? undefined : logoSrc
const facebook = $('.facebook').parent().attr('href')
const twitter = $('.twitter').parent().attr('href')
const instagram = $('.instagram').parent().attr('href')
Expand Down Expand Up @@ -109,7 +109,7 @@ export const getTeam =
name: $('.team-country .flag').attr('alt'),
code: $('.team-country .flag').attrThen(
'src',
(x) => x.split('/').pop()?.split('.')[0]!
(x) => x?.split('/').pop()?.split('.')[0]!
)
}

Expand Down