epg-grabber 0.28.2 → 0.28.3

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/parser.js +5 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "epg-grabber",
3
- "version": "0.28.2",
3
+ "version": "0.28.3",
4
4
  "description": "Node.js CLI tool for grabbing EPG from different sites",
5
5
  "main": "src/index.js",
6
6
  "preferGlobal": true,
package/src/parser.js CHANGED
@@ -18,12 +18,12 @@ function parseChannels(xml) {
18
18
  const channels = channelsTag.elements
19
19
  .filter(el => el.name === 'channel')
20
20
  .map(el => {
21
- let { xmltv_id, site, logo } = el.attributes
22
- const name = el.elements.find(el => el.type === 'text').text
23
- if (!name) throw new Error(`Channel '${xmltv_id}' has no valid name`)
24
- site = site || rootSite
21
+ const data = el.attributes
22
+ data.name = el.elements.find(el => el.type === 'text').text
23
+ data.site = data.site || rootSite
24
+ if (!data.name) throw new Error(`Channel '${data.xmltv_id}' has no valid name`)
25
25
 
26
- return new Channel({ name, xmltv_id, logo, site })
26
+ return new Channel(data)
27
27
  })
28
28
 
29
29
  return { site: rootSite, channels }