master117 / MagicMirror-FootballLeagues

A live viewer for recent soccer results and league tables. Outdated!
GNU General Public License v3.0
8 stars 5 forks source link

Fixture not updated #9

Closed prysme01 closed 5 years ago

prysme01 commented 6 years ago

Hello, since the v2 api, the fixtures are not displayed properly, it only show the first matches of the leagues instead of the last ones.

Also It seems that the League table is not well updated (at least in my case for League1 and Serie A) the scores are not the last ones.

I've asked Daniel from football-data.org about the delayed score from the free tiers, and he says the score are only delayed from 1 to 10 min.

So I presume there is a bug somewhere.

master117 commented 6 years ago

Hi, thanks for the notice.

the fixtures are not displayed properly, it only show the first matches of the leagues instead of the last ones.

I just updated and changed the way the current matchdate is calculated (that selects which matches are calculated). It now always shows all matches from Monday of the current week to the next Sunday. https://i.imgur.com/Q6MN55q.png

Also It seems that the League table is not well updated

I can not comment on this, as it seems correct at the moment. https://i.imgur.com/506aPbt.png

prysme01 commented 6 years ago

I got an error with the update

0|mm | TypeError: Cannot read property 'length' of undefined 0|mm | at Request._callback (/home/pi/MagicMirror/modules/MagicMirror-FootballLeagues/node_helper.js:88:62) 0|mm | at Request.self.callback (/home/pi/MagicMirror/node_modules/request/request.js:186:22) 0|mm | at emitTwo (events.js:126:13) 0|mm | at Request.emit (events.js:214:7) 0|mm | at Request. (/home/pi/MagicMirror/node_modules/request/request.js:1163:10) 0|mm | at emitOne (events.js:116:13) 0|mm | at Request.emit (events.js:211:7) 0|mm | at IncomingMessage. (/home/pi/MagicMirror/node_modules/request/request.js:1085:12) 0|mm | at Object.onceWrapper (events.js:313:30) 0|mm | at emitNone (events.js:111:20)

prysme01 commented 6 years ago

Nevermind a npm install solve this issue.

ruffneck2 commented 6 years ago

Thank you for updating the module to apiV2. Unfortunately I also experienced an error that now all matches from begin of league start until current moment will be shown. The league table will be displayed correctly, but the matches are from the beginning and not only the last one. live-scores-bundesliga-match-days live-scores-bundesliga-table

master117 commented 6 years ago

@ruffneck2 The issue seems to have solved for prysme01 with the latest update. Are you sure that you have the newest version? It should only load the current week.

ruffneck2 commented 5 years ago

@master117 Yes, today I've checked again and performed git pull again, but it says that current installed version is the latest. As you can see in newest screenshot the league table has been updated but it does not show any match results from the weekend.

{ module: "MagicMirror-FootballLeagues", position: "top_right", header: "Live-Scores", config: { leagues: [2002], showNames: true, displayTime: 30 * 1000, showTables: true, showLogos: true, apiKey: "super secret" } }, I'm using a RPi 2 Model B V1.1 with latest version of Raspbian Stretch and MM 2.5.0. 2018-10-08-103602_1680x1050_scrot

I hope this will help you.

master117 commented 5 years ago

Can you tell me what exactly you mean with: "does not show any match results from the weekend"? Like, what would yo be expecting to see? You can also answer in german if you prefer that.

The table looks fine https://i.imgur.com/L7vlO90.png so I sadly don't understand the problem.

Greetings

ruffneck2 commented 5 years ago

Usually the scoreboard switches between league table and league matches depending on your set up displayTime values. While the league table was displayed correctly, in my case nothing has been displayed on the scoreboard when switching to the league matches. So the scoreboard becomes blank for league matches until it switches back to league table. Anyway, I wanted to make a short video of the phenomenon, as I remembered that I could perform a "npm restart". After the Magicmirror has been restarted after performing "npm restart", strangely, both the league table and the upcoming league matches will be displayed correctly. These are now without results, as last weekend there were no league matches, but only Nations League.

However, if it's okay for you I would like to wait the upcoming weekend until Monday to see if everything works well even after the next league match day.

ruffneck2 commented 5 years ago

Today I have checked again the results of all matches, but unfortunately the scoreboard only shows me the upcoming matches. Again the League table will be displayed correct. I have created a short video of around 1minute to show you the issue which is attached as zip file. If you prefer any other platform to upload the file, please let me know. For troubleshooting I again have performed 'npm restart' but without success. MM-FootballLeagues.zip

master117 commented 5 years ago

Ok, sorry it took me so long to respond. Currently the mirror is set up to grab all matches between last Monday and next Suday. So if you open it on Monday it shows all matches until Sunday, not the ones before. If you want I can change it so it also shows last week. @ruffneck2

ruffneck2 commented 5 years ago

@master117 Thank you for your confirmation. I think I found the relevant parts in MagicMirror-FootballLeagues.js (lines 435 -> 473). But, as I'm not really familar with programming, could you please be so kind to let me know the value I have to set to display only the results of last matches, when opening the Mirror the week after the matches were played?

master117 commented 5 years ago

The relevant line is actually in 2 files: MagicMirror-FootballLeagues.js Line: 438 https://github.com/master117/MagicMirror-FootballLeagues/blob/master/MagicMirror-FootballLeagues.js#L438

var startOfThisWeek = moment().startOf('isoWeek'); which should be changed to: var startOfThisWeek = moment().startOf('isoWeek').subtract(7, 'days');

and node_helper.js Line: 125 https://github.com/master117/MagicMirror-FootballLeagues/blob/master/node_helper.js#L125

var begin = moment().startOf('isoWeek').format('YYYY-MM-DD'); which should be changed to: var begin = moment().startOf('isoWeek').subtract(7, 'days').format('YYYY-MM-DD');

These lines define the first date to be displayed, the following lines in both cases are the last date to be displayed. You may have to change these in the same way, depending on what exactly you want to see.

moment() gets the current date, .startOf('isoWeek') jumps back to the beginning of the week matching the current date, .subtract(7, 'days') reduces the date by another week

https://momentjs.com/

ruffneck2 commented 5 years ago

Sorry for my delay. I have tested now a lot and it is working for me as it should after changing the mentioned lines. So therefore my issue is solved and I would like to thank you very much for your efforts and strong support.