mirror of
https://github.com/iptv-org/epg.git
synced 2025-05-10 00:50:09 -04:00
Merge pull request #1979 from iptv-org/remove-json-version
Remove JSON version of the guides
This commit is contained in:
commit
79d5ec772d
8 changed files with 2 additions and 43 deletions
|
@ -33,7 +33,7 @@ You can also find the link to the guide by the name of the channel via https://i
|
||||||
</details>
|
</details>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
All guides also have a compressed and JSON version. To load them just change the extension from `.xml` to `.xml.gz` or `.json` respectively.
|
To load the compressed version of the guide, just change the extension from `.xml` to `.xml.gz`.
|
||||||
|
|
||||||
## Playlists
|
## Playlists
|
||||||
|
|
||||||
|
|
|
@ -91,15 +91,12 @@ async function save(filepath, programs) {
|
||||||
|
|
||||||
const xmlFilepath = `${PUBLIC_DIR}/guides/${filepath}.xml`
|
const xmlFilepath = `${PUBLIC_DIR}/guides/${filepath}.xml`
|
||||||
const gzFilepath = `${PUBLIC_DIR}/guides/${filepath}.xml.gz`
|
const gzFilepath = `${PUBLIC_DIR}/guides/${filepath}.xml.gz`
|
||||||
const jsonFilepath = `${PUBLIC_DIR}/guides/${filepath}.json`
|
|
||||||
logger.info(`creating ${xmlFilepath}...`)
|
logger.info(`creating ${xmlFilepath}...`)
|
||||||
const xmltv = generateXMLTV(output)
|
const xmltv = generateXMLTV(output)
|
||||||
await file.create(xmlFilepath, xmltv)
|
await file.create(xmlFilepath, xmltv)
|
||||||
logger.info(`creating ${gzFilepath}...`)
|
logger.info(`creating ${gzFilepath}...`)
|
||||||
const compressed = await zip.compress(xmltv)
|
const compressed = await zip.compress(xmltv)
|
||||||
await file.create(gzFilepath, compressed)
|
await file.create(gzFilepath, compressed)
|
||||||
logger.info(`creating ${jsonFilepath}...`)
|
|
||||||
await file.create(jsonFilepath, JSON.stringify(output))
|
|
||||||
|
|
||||||
return output
|
return output
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,7 @@ You can also find the link to the guide by the name of the channel via https://i
|
||||||
</details>
|
</details>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
All guides also have a compressed and JSON version. To load them just change the extension from `.xml` to `.xml.gz` or `.json` respectively.
|
To load the compressed version of the guide, just change the extension from `.xml` to `.xml.gz`.
|
||||||
|
|
||||||
## Playlists
|
## Playlists
|
||||||
|
|
||||||
|
|
|
@ -1 +0,0 @@
|
||||||
{"channels":[{"id":"6eren.dk","name":"6'eren","site":"allente.se","lang":"da","logo":"https://upload.wikimedia.org/wikipedia/commons/6/64/6%27eren_2015.png","url":"https://allente.se"}],"programs":[{"site":"allente.se","channel":"6eren.dk","titles":[{"value":"Diners, Drive-Ins and Dives","lang":"da"}],"sub_titles":[],"descriptions":[{"value":"Underholdning","lang":"da"}],"icon":{"src":"https://viasatps.api.comspace.se/PS/channeldate/image/viasat.ps/487/2022-10-24/se.cs.6eren.event.B_0254194276971024040000.jpg?size=2560x1440"},"episodeNumbers":[{"system":"xmltv_ns","value":"23.5.0/1"},{"system":"onscreen","value":"S24E06"}],"date":null,"start":1666584000000,"stop":1666585500000,"urls":[],"ratings":[],"categories":[{"value":"series","lang":"da"}],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]}],"date":"2022-10-20"}
|
|
|
@ -1 +0,0 @@
|
||||||
{"channels":[{"id":"BBCNews.uk","name":"BBC News","site":"sky.com","lang":"en","logo":"https://i.imgur.com/rPzH88J.png","url":"https://sky.com"}],"programs":[{"site":"sky.com","channel":"BBCNews.uk","titles":[{"value":"BBC News at One","lang":"en"}],"sub_titles":[],"descriptions":[{"value":"The latest national and international news from the BBC. [S,SL]","lang":"en"}],"icon":{"src":"http://epgstatic.sky.com/epgdata/1.0/paimage/46/1/lisa/5.2.2/linear/channel/ca247bc8-6be0-48f9-88d1-865f87f7680e/2011"},"episodeNumbers":[],"date":null,"start":1666872000000,"stop":1666873800000,"urls":[],"ratings":[],"categories":[],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]}],"date":"2022-10-20"}
|
|
|
@ -1 +0,0 @@
|
||||||
{"channels":[{"id":"BBCNews.uk","name":"BBC News","site":"virginmedia.com","lang":"en","logo":"https://i.imgur.com/rPzH88J.png","url":"https://virginmedia.com"}],"programs":[{"site":"virginmedia.com","channel":"BBCNews.uk","titles":[{"value":"BBC News at One","lang":"en"}],"sub_titles":[],"descriptions":[{"value":"The latest national and international news, followed by weather.","lang":"en"}],"icon":{"src":""},"episodeNumbers":[{"system":"xmltv_ns","value":"96839999.145799123.0/1"},{"system":"onscreen","value":"S96840000E145799124"}],"date":null,"start":1666872000000,"stop":1666873800000,"urls":[],"ratings":[],"categories":[{"value":"News","lang":"en"}],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]}],"date":"2022-10-20"}
|
|
|
@ -1 +0,0 @@
|
||||||
{"channels":[{"id":"BBCNews.uk","name":"BBC News","site":"sky.com","lang":"fr","logo":"https://i.imgur.com/rPzH88J.png","url":"https://sky.com"},{"id":"CNN.us","name":"CNN","site":"sky.com","lang":"fr","logo":"https://www.directv.com/images/logos/channels/dark/large/579.png","url":"https://sky.com"}],"programs":[{"site":"sky.com","channel":"BBCNews.uk","titles":[{"value":"BBC News at One","lang":"fr"}],"sub_titles":[],"descriptions":[{"value":"Les dernières nouvelles nationales et internationales de la BBC. [S,SL]","lang":"fr"}],"icon":{"src":"http://epgstatic.sky.com/epgdata/1.0/paimage/46/1/lisa/5.2.2/linear/channel/ca247bc8-6be0-48f9-88d1-865f87f7680e/2011"},"episodeNumbers":[],"date":null,"start":1666872000000,"stop":1666873800000,"urls":[],"ratings":[],"categories":[],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]},{"site":"sky.com","channel":"CNN.us","titles":[{"value":"French title","lang":"fr"}],"sub_titles":[],"descriptions":[],"icon":{"src":""},"episodeNumbers":[],"date":null,"start":1666872000000,"stop":1666873800000,"urls":[],"ratings":[],"categories":[],"directors":[],"actors":[],"writers":[],"adapters":[],"producers":[],"composers":[],"editors":[],"presenters":[],"commentators":[],"guests":[]}],"date":"2022-10-20"}
|
|
|
@ -17,32 +17,6 @@ it('can generate /guides', () => {
|
||||||
{ encoding: 'utf8' }
|
{ encoding: 'utf8' }
|
||||||
)
|
)
|
||||||
|
|
||||||
expect(stdout).toBe(
|
|
||||||
`
|
|
||||||
> guides:update
|
|
||||||
> NODE_OPTIONS=--max-old-space-size=5120 node scripts/commands/guides/update.js
|
|
||||||
|
|
||||||
starting...
|
|
||||||
loading data/channels.json...
|
|
||||||
loading database/programs.db...
|
|
||||||
found 6 programs
|
|
||||||
creating tests/__data__/output/guides/da/allente.se.xml...
|
|
||||||
creating tests/__data__/output/guides/da/allente.se.xml.gz...
|
|
||||||
creating tests/__data__/output/guides/da/allente.se.json...
|
|
||||||
creating tests/__data__/output/guides/en/virginmedia.com.xml...
|
|
||||||
creating tests/__data__/output/guides/en/virginmedia.com.xml.gz...
|
|
||||||
creating tests/__data__/output/guides/en/virginmedia.com.json...
|
|
||||||
creating tests/__data__/output/guides/fr/sky.com.xml...
|
|
||||||
creating tests/__data__/output/guides/fr/sky.com.xml.gz...
|
|
||||||
creating tests/__data__/output/guides/fr/sky.com.json...
|
|
||||||
creating tests/__data__/output/guides/en/sky.com.xml...
|
|
||||||
creating tests/__data__/output/guides/en/sky.com.xml.gz...
|
|
||||||
creating tests/__data__/output/guides/en/sky.com.json...
|
|
||||||
creating tests/__data__/output/logs/guides/update.log...
|
|
||||||
finished
|
|
||||||
`
|
|
||||||
)
|
|
||||||
|
|
||||||
const uncompressed = glob
|
const uncompressed = glob
|
||||||
.sync('tests/__data__/expected/guides/**/*.xml')
|
.sync('tests/__data__/expected/guides/**/*.xml')
|
||||||
.map(f => f.replace('tests/__data__/expected/', ''))
|
.map(f => f.replace('tests/__data__/expected/', ''))
|
||||||
|
@ -59,14 +33,6 @@ finished
|
||||||
expect(content(`output/${filepath}`), filepath).toBe(content(`expected/${filepath}`))
|
expect(content(`output/${filepath}`), filepath).toBe(content(`expected/${filepath}`))
|
||||||
})
|
})
|
||||||
|
|
||||||
const json = glob
|
|
||||||
.sync('tests/__data__/expected/guides/**/*.json')
|
|
||||||
.map(f => f.replace('tests/__data__/expected/', ''))
|
|
||||||
|
|
||||||
json.forEach(filepath => {
|
|
||||||
expect(content(`output/${filepath}`), filepath).toBe(content(`expected/${filepath}`))
|
|
||||||
})
|
|
||||||
|
|
||||||
expect(content('output/logs/guides/update.log')).toEqual(
|
expect(content('output/logs/guides/update.log')).toEqual(
|
||||||
content('expected/logs/guides/update.log')
|
content('expected/logs/guides/update.log')
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue