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 +1 -1
- package/src/utils.js +2 -2
- package/tests/utils.test.js +6 -6
package/package.json
CHANGED
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.
|
|
127
|
-
const stop = program.stop ? dayjs.
|
|
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
|
|
package/tests/utils.test.js
CHANGED
|
@@ -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:
|
|
60
|
-
stop:
|
|
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:
|
|
88
|
-
stop:
|
|
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:
|
|
108
|
-
stop:
|
|
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',
|