epg-grabber 0.15.0 → 0.15.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "epg-grabber",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
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
@@ -123,8 +123,8 @@ utils.convertToXMLTV = function ({ channels, programs }) {
123
123
  const title = utils.escapeString(program.title)
124
124
  const description = utils.escapeString(program.description)
125
125
  const categories = Array.isArray(program.category) ? program.category : [program.category]
126
- const start = program.start ? dayjs.utc(program.start).format('YYYYMMDDHHmmss ZZ') : ''
127
- const stop = program.stop ? dayjs.utc(program.stop).format('YYYYMMDDHHmmss ZZ') : ''
126
+ const start = program.start ? dayjs.unix(program.start).utc().format('YYYYMMDDHHmmss ZZ') : ''
127
+ const stop = program.stop ? dayjs.unix(program.stop).utc().format('YYYYMMDDHHmmss ZZ') : ''
128
128
  const lang = program.lang || 'en'
129
129
  const icon = utils.escapeString(program.icon)
130
130
 
@@ -56,8 +56,8 @@ it('can convert object to xmltv string', () => {
56
56
  {
57
57
  title: 'Program 1',
58
58
  description: 'Description for Program 1',
59
- start: '2021-03-19 06:00:00 +0000',
60
- stop: '2021-03-19 06:30:00 +0000',
59
+ start: 1616133600,
60
+ stop: 1616135400,
61
61
  category: 'Test',
62
62
  icon: 'https://example.com/images/Program1.png?x=шеллы&sid=777',
63
63
  channel: '1TV.com',
@@ -84,8 +84,8 @@ it('can convert object to xmltv string without categories', () => {
84
84
  const programs = [
85
85
  {
86
86
  title: 'Program 1',
87
- start: '2021-03-19 06:00:00 +0000',
88
- stop: '2021-03-19 06:30:00 +0000',
87
+ start: 1616133600,
88
+ stop: 1616135400,
89
89
  channel: '1TV.com',
90
90
  lang: 'it'
91
91
  }
@@ -104,8 +104,8 @@ it('can convert object to xmltv string with multiple categories', () => {
104
104
  {
105
105
  title: 'Program 1',
106
106
  description: 'Description for Program 1',
107
- start: '2021-03-19 06:00:00 +0000',
108
- stop: '2021-03-19 06:30:00 +0000',
107
+ start: 1616133600,
108
+ stop: 1616135400,
109
109
  category: ['Test1', 'Test2'],
110
110
  icon: 'https://example.com/images/Program1.png?x=шеллы&sid=777',
111
111
  channel: '1TV.com',