mlbserver 2026.2.20 → 2026.2.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +5 -2
- package/package.json +1 -1
- package/session.js +17 -9
package/index.js
CHANGED
|
@@ -1442,10 +1442,13 @@ app.get('/', async function(req, res) {
|
|
|
1442
1442
|
}
|
|
1443
1443
|
let cache_name = gameDate
|
|
1444
1444
|
if ( level_ids != levels['MLB'] ) {
|
|
1445
|
-
cache_name += '.' + level_ids
|
|
1445
|
+
cache_name += '.' + level_ids.replaceAll(',', '')
|
|
1446
1446
|
}
|
|
1447
1447
|
if ( team_ids != '' ) {
|
|
1448
|
-
cache_name += '.' + team_ids
|
|
1448
|
+
cache_name += '.' + team_ids.replaceAll(',', '')
|
|
1449
|
+
}
|
|
1450
|
+
if ( cache_name.length > 250 ) {
|
|
1451
|
+
cache_name = cache_name.slice(0, 250)
|
|
1449
1452
|
}
|
|
1450
1453
|
|
|
1451
1454
|
var cache_data = await session.getDayData(gameDate, false, level_ids, team_ids)
|
package/package.json
CHANGED
package/session.js
CHANGED
|
@@ -2051,11 +2051,15 @@ class sessionClass {
|
|
|
2051
2051
|
let cache_data
|
|
2052
2052
|
let cache_name = dateString
|
|
2053
2053
|
if ( level_ids != LEVELS['MLB'] ) {
|
|
2054
|
-
cache_name += '.' + level_ids
|
|
2054
|
+
cache_name += '.' + level_ids.replaceAll(',', '')
|
|
2055
2055
|
}
|
|
2056
2056
|
if ( team_ids != '' ) {
|
|
2057
|
-
cache_name += '.' + team_ids
|
|
2057
|
+
cache_name += '.' + team_ids.replaceAll(',', '')
|
|
2058
2058
|
}
|
|
2059
|
+
if ( cache_name.length > 250 ) {
|
|
2060
|
+
cache_name = cache_name.slice(0, 250)
|
|
2061
|
+
}
|
|
2062
|
+
|
|
2059
2063
|
//let data_url = 'https://bdfed.stitch.mlbinfra.com/bdfed/transform-mlb-scoreboard?stitch_env=prod&sortTemplate=2&sportId=1&sportId=17&startDate=' + dateString + '&endDate=' + dateString + '&gameType=E&&gameType=S&&gameType=R&&gameType=F&&gameType=D&&gameType=L&&gameType=W&&gameType=A&language=en&leagueId=104&leagueId=103&leagueId=131&contextTeamId='
|
|
2060
2064
|
let data_url = 'https://statsapi.mlb.com/api/v1/schedule?sportId=' + level_ids
|
|
2061
2065
|
if ( team_ids != '' ) {
|
|
@@ -2151,13 +2155,16 @@ class sessionClass {
|
|
|
2151
2155
|
let utcHours = 5
|
|
2152
2156
|
|
|
2153
2157
|
let cache_data
|
|
2154
|
-
let cache_name = '
|
|
2158
|
+
let cache_name = 'w'
|
|
2155
2159
|
|
|
2156
2160
|
if ( level_ids != LEVELS['All'] ) {
|
|
2157
|
-
cache_name += '.' + level_ids
|
|
2161
|
+
cache_name += '.' + level_ids.replaceAll(',', '')
|
|
2158
2162
|
}
|
|
2159
2163
|
if ( team_ids != '' ) {
|
|
2160
|
-
cache_name += '.' + team_ids
|
|
2164
|
+
cache_name += '.' + team_ids.replaceAll(',', '')
|
|
2165
|
+
}
|
|
2166
|
+
if ( cache_name.length > 250 ) {
|
|
2167
|
+
cache_name = cache_name.slice(0, 250)
|
|
2161
2168
|
}
|
|
2162
2169
|
|
|
2163
2170
|
let cache_file = path.join(this.CACHE_DIRECTORY, cache_name + '.json')
|
|
@@ -2493,10 +2500,11 @@ class sessionClass {
|
|
|
2493
2500
|
|
|
2494
2501
|
if ( (broadcast.type == 'TV') || ((mediaType == 'Audio') && (broadcast.language == language)) ) {
|
|
2495
2502
|
let teamType = broadcast.homeAway
|
|
2503
|
+
let opponent_teamType = 'away'
|
|
2496
2504
|
|
|
2497
|
-
if ( (mediaType == 'MLBTV') && (cache_data.dates[i].games[j].seriesDescription != 'Regular Season') && (cache_data.dates[i].games[j].seriesDescription != 'Spring Training') ) {
|
|
2505
|
+
/*if ( (mediaType == 'MLBTV') && (cache_data.dates[i].games[j].seriesDescription != 'Regular Season') && (cache_data.dates[i].games[j].seriesDescription != 'Spring Training') ) {
|
|
2498
2506
|
teamType = 'NATIONAL'
|
|
2499
|
-
}
|
|
2507
|
+
}*/
|
|
2500
2508
|
let team = cache_data.dates[i].games[j].teams['home'].team.abbreviation
|
|
2501
2509
|
let opponent_team = cache_data.dates[i].games[j].teams['away'].team.abbreviation
|
|
2502
2510
|
|
|
@@ -2511,7 +2519,6 @@ class sessionClass {
|
|
|
2511
2519
|
}
|
|
2512
2520
|
} else {
|
|
2513
2521
|
teamType = teamType.toLowerCase()
|
|
2514
|
-
let opponent_teamType = 'away'
|
|
2515
2522
|
if ( teamType == 'away' ) {
|
|
2516
2523
|
opponent_teamType = 'home'
|
|
2517
2524
|
}
|
|
@@ -2521,8 +2528,9 @@ class sessionClass {
|
|
|
2521
2528
|
if ( (excludeTeams.length > 0) && (excludeTeams.includes(team) || excludeTeams.includes(opponent_team) || ((teamType == 'NATIONAL') && excludeTeams.includes(teamType))) ) {
|
|
2522
2529
|
continue
|
|
2523
2530
|
} else if ( (includeTeams.length == 0) || includeTeams.includes(team) || ((teamType == 'NATIONAL') && (includeTeams.includes(teamType) || includeTeams.includes(opponent_team))) || ((broadcast_count == 1) && includeTeams.includes(opponent_team)) || ((broadcast.freeGame == true) && includeTeams.includes('FREE')) ) {
|
|
2524
|
-
if ( (broadcast_count == 1) && !includeTeams.includes(team) && includeTeams.includes(opponent_team) ) {
|
|
2531
|
+
if ( (teamType != 'NATIONAL') && (broadcast_count == 1) && !includeTeams.includes(team) && includeTeams.includes(opponent_team) ) {
|
|
2525
2532
|
team = opponent_team
|
|
2533
|
+
teamType = opponent_teamType
|
|
2526
2534
|
}
|
|
2527
2535
|
let logo = 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRi5AKF6eAu9Va9BzZzgw0PSsQXw8rXPiQLHA'
|
|
2528
2536
|
let seriesId = 'MLB'
|