epg-grabber 0.18.0 → 0.19.0

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.
@@ -79,7 +79,7 @@ async function main() {
79
79
  if (!config.channels) return logger.error('Path to [site].channels.xml is missing')
80
80
  logger.info(`Loading '${config.channels}'...`)
81
81
  const channelsXML = fs.readFileSync(path.resolve(config.channels), { encoding: 'utf-8' })
82
- const channels = utils.parseChannels(channelsXML)
82
+ const { channels } = utils.parseChannels(channelsXML)
83
83
 
84
84
  let programs = []
85
85
  let i = 1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "epg-grabber",
3
- "version": "0.18.0",
3
+ "version": "0.19.0",
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/utils.js CHANGED
@@ -65,7 +65,7 @@ utils.parseChannels = function (xml) {
65
65
  return channel
66
66
  })
67
67
 
68
- return channels
68
+ return { site, channels }
69
69
  }
70
70
 
71
71
  utils.sleep = function (ms) {
@@ -28,7 +28,7 @@ it('can load valid config.js', () => {
28
28
 
29
29
  it('can parse valid channels.xml', () => {
30
30
  const file = fs.readFileSync('./tests/input/example.com.channels.xml', { encoding: 'utf-8' })
31
- const channels = utils.parseChannels(file)
31
+ const { channels } = utils.parseChannels(file)
32
32
  expect(channels).toEqual([
33
33
  {
34
34
  name: '1 TV',
@@ -51,7 +51,7 @@ it('can parse valid channels.xml', () => {
51
51
 
52
52
  it('can convert object to xmltv string', () => {
53
53
  const file = fs.readFileSync('./tests/input/example.com.channels.xml', { encoding: 'utf-8' })
54
- const channels = utils.parseChannels(file)
54
+ const { channels } = utils.parseChannels(file)
55
55
  const programs = [
56
56
  {
57
57
  title: 'Program 1',
@@ -101,7 +101,7 @@ it('can convert object to xmltv string without categories', () => {
101
101
 
102
102
  it('can convert object to xmltv string with multiple categories', () => {
103
103
  const file = fs.readFileSync('./tests/input/example.com.channels.xml', { encoding: 'utf-8' })
104
- const channels = utils.parseChannels(file)
104
+ const { channels } = utils.parseChannels(file)
105
105
  const programs = [
106
106
  {
107
107
  title: 'Program 1',