futcal-for-scriptable icon indicating copy to clipboard operation
futcal-for-scriptable copied to clipboard

No Games Data

Open TheBreznsoiza opened this issue 2 years ago • 8 comments

Hey guys anyone else seeing this bug, "no data" on the left where the games should appear?

Standings are okay, seemed that FotMob has changed something again image

TheBreznsoiza avatar Nov 01 '22 07:11 TheBreznsoiza

Hey @DasBlatz, I am facing the same issue. @thejosejorge Can you please have a look? Thanks in advance.

matthiasjaekel avatar Nov 01 '22 10:11 matthiasjaekel

Yes, i'm facing this issue for a week now!

Seems that no one hasn't found out a quick fix for this 🙃

beratgashi avatar Nov 01 '22 17:11 beratgashi

I just noticed it and here's the fix.

First of all, you need to find the function named "addWidgetMatches". Based on Jose's code, it starts from line 164.

Then, just replace old code to new one as below.

Old :

async function addWidgetMatches(globalStack) {
    const nextMatch = teamData.nextMatch;

    let previousMatchIndex = teamData.fixtures.length - 1;
    if (nextMatch) {
      for (let i = 0; i < teamData.fixtures.length; i += 1) {
          if (teamData.fixtures[i].id === nextMatch.id) {
              previousMatchIndex = i - 1;
              break;
          }
      }
    }
    const previousMatch = teamData.fixtures[previousMatchIndex];

NEW :

async function addWidgetMatches(globalStack) {
    const nextMatch = teamData.fixtures.allFixtures.nextMatch;

    let previousMatchIndex = teamData.fixtures.allFixtures.fixtures.length - 1;
    if (nextMatch) {
      for (let i = 0; i < teamData.fixtures.allFixtures.fixtures.length; i += 1) {
          if (teamData.fixtures.allFixtures.fixtures[i].id === nextMatch.id) {
              previousMatchIndex = i - 1;
              break;
          }
      }
    }
    const previousMatch = teamData.fixtures.allFixtures.fixtures[previousMatchIndex];

Hope it helps you guys. @DasBlatz @beratgashi @matthiasjaekel

hangoon-p avatar Nov 02 '22 08:11 hangoon-p

@hangoon-p thank youuu man it works perfectly 👏

beratgashi avatar Nov 02 '22 08:11 beratgashi

Guys, After I fixed that error, I found out the match time shows the timezone which your team located. (not your local time.) If you have same problem, follow the instruction below.

First, find the code which you need to change. In Jose's code, it is at Line 202.

const matchDetailsUrl = `${matchDetailsApiUrl}${match.id}`;

If you find it, replace it to the code as below.

const matchDetailsUrl = `${matchDetailsApiUrl}${match.id}&timezone=${userSettings.timeZone}`;

There's a thing left to change.

Find the code to change. (In Jose's, Line 84)

const teamDataApiUrl = encodeURI(`${baseApiUrl}/api/teams?id=${userSettings.teamId}&tab=overview&type=team&timeZone=${userSettings.timeZone}`);

Then replace it to below.

const teamDataApiUrl = encodeURI(`${baseApiUrl}/api/teams?id=${userSettings.teamId}&tab=overview&type=team&timezone=${userSettings.timeZone}`);

It will show right match time in your local timezone.

@DasBlatz @beratgashi @matthiasjaekel

hangoon-p avatar Nov 02 '22 09:11 hangoon-p

Hey @hangoon-p, once again we need your help on fixing the new issue undefined is not an object!

Thanks for your efforts on helping us!

beratgashi avatar Dec 12 '22 16:12 beratgashi

@beratgashi I issued new post for this. In there you can find my solution.

hangoon-p avatar Dec 13 '22 01:12 hangoon-p

Now, I have this error : 2024-01-27 18:08:41: Error on line 297:131: TypeError: undefined is not an object (evaluating '(matchDetails.content.matchFacts.infoBox["Match Date"].dateFormatted).replaceAll')

How can I fix that ?

JuJT avatar Jan 27 '24 17:01 JuJT