Update utils.js
This commit is contained in:
		
							parent
							
								
									b619ce2254
								
							
						
					
					
						commit
						8940f5fc33
					
				| 
						 | 
					@ -171,8 +171,13 @@ utils.parsePrograms = function ({ response, item, config }) {
 | 
				
			||||||
    buffer: response.data
 | 
					    buffer: response.data
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return config
 | 
					  const programs = config.parser(options)
 | 
				
			||||||
    .parser(options)
 | 
					
 | 
				
			||||||
 | 
					  if (!Array.isArray(programs)) {
 | 
				
			||||||
 | 
					    throw new Error('Parser should return an array')
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  return programs
 | 
				
			||||||
    .filter(i => i)
 | 
					    .filter(i => i)
 | 
				
			||||||
    .map(p => {
 | 
					    .map(p => {
 | 
				
			||||||
      p.channel = item.channel.xmltv_id
 | 
					      p.channel = item.channel.xmltv_id
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue