mlbserver 2025.2.21 → 2025.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.
Files changed (3) hide show
  1. package/index.js +8 -5
  2. package/package.json +1 -1
  3. package/session.js +3 -0
package/index.js CHANGED
@@ -198,7 +198,7 @@ var hls = new HLSServer(multiview_app, {
198
198
  path: '/' + hls_base,
199
199
  dir: session.get_multiview_directory()
200
200
  })
201
- function corsMiddleware (req, res, next) {
201
+ function corsMiddleware(req, res, next) {
202
202
  res.setHeader('Access-Control-Allow-Origin', '*');
203
203
  next()
204
204
  }
@@ -1285,8 +1285,11 @@ app.get('/', async function(req, res) {
1285
1285
  team_ids = session.getTeamIds()
1286
1286
  for (let i=0; i<session.credentials.fav_teams.length; i++) {
1287
1287
  if ( session.credentials.fav_teams[i] != '' ) {
1288
- level_ids = levels['All']
1289
- team_ids += ',' + session.getAffiliateTeamIds(session.credentials.fav_teams[i])
1288
+ let affiliate_team_ids = session.getAffiliateTeamIds(session.credentials.fav_teams[i])
1289
+ if ( affiliate_team_ids ) {
1290
+ level_ids = levels['All']
1291
+ team_ids += ',' + affiliate_team_ids
1292
+ }
1290
1293
  }
1291
1294
  }
1292
1295
  }
@@ -2750,7 +2753,7 @@ function start_multiview_stream(streams, sync, dvr, faster, reencode, park_audio
2750
2753
  //let audio_input = audio_present[i] + ':a:m:language:en?'
2751
2754
  let audio_input = audio_present[i] + ':a:'
2752
2755
  let video_url = streams[audio_present[i]]
2753
- if ( video_url.includes('audio_track=English') || !video_url.includes('audio_track=') ) {
2756
+ if ( !video_url || video_url.includes('audio_track=English') || !video_url.includes('audio_track=') ) {
2754
2757
  audio_input += '0'
2755
2758
  } else {
2756
2759
  audio_input += '1'
@@ -2793,7 +2796,7 @@ function start_multiview_stream(streams, sync, dvr, faster, reencode, park_audio
2793
2796
  } else {
2794
2797
  audio_output = audio_present[i] + ':a:'
2795
2798
  let video_url = streams[audio_present[i]]
2796
- if ( video_url.includes('audio_track=English') || !video_url.includes('audio_track=') ) {
2799
+ if ( !video_url || video_url.includes('audio_track=English') || !video_url.includes('audio_track=') ) {
2797
2800
  audio_output += '0'
2798
2801
  } else {
2799
2802
  audio_output += '1'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mlbserver",
3
- "version": "2025.02.21",
3
+ "version": "2025.02.23",
4
4
  "description": "",
5
5
  "repository": {
6
6
  "type": "git",
package/session.js CHANGED
@@ -961,6 +961,9 @@ class sessionClass {
961
961
  this.save_credentials()
962
962
  }
963
963
  }
964
+ if ( (this.credentials.fav_teams != '') && !this.credentials.fav_teams.every(v => Object.keys(TEAM_IDS).includes(v)) ) {
965
+ this.log('warning: one or more fav_teams abbreviation is invalid')
966
+ }
964
967
 
965
968
  // Check if free account
966
969
  this.free = false