diff --git a/.sites/.gitignore b/.sites/.gitignore deleted file mode 100644 index 3eab715b..00000000 --- a/.sites/.gitignore +++ /dev/null @@ -1 +0,0 @@ -_table.md \ No newline at end of file diff --git a/.sites/config.json b/.sites/config.json deleted file mode 100644 index d77113c1..00000000 --- a/.sites/config.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "build" : "SITES.md", - "files" : ["./.sites/template.md"] -} \ No newline at end of file diff --git a/.sites/template.md b/.sites/template.md deleted file mode 100644 index 0f16f542..00000000 --- a/.sites/template.md +++ /dev/null @@ -1,4 +0,0 @@ -# Sites - - -#include "./.sites/_table.md" diff --git a/SITES.md b/SITES.md index 25429c7a..cdcb604d 100644 --- a/SITES.md +++ b/SITES.md @@ -1,11 +1,233 @@ # Sites - +\* Total number of channels / with a valid `xmltv-id` + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +======= diff --git a/package-lock.json b/package-lock.json index 39b678c5..31a33148 100644 --- a/package-lock.json +++ b/package-lock.json @@ -56,7 +56,6 @@ "libxml2-wasm": "^0.5.0", "lodash": "^4.17.21", "luxon": "^3.3.0", - "markdown-include": "^0.4.3", "mockdate": "^3.0.5", "nedb-promises": "^6.0.3", "node-cleanup": "^2.1.2", @@ -6420,17 +6419,6 @@ "tmpl": "1.0.5" } }, - "node_modules/markdown-include": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/markdown-include/-/markdown-include-0.4.3.tgz", - "integrity": "sha512-kw1f+iJ8jAH9SYljv2RXmhRQFr2oMPPVdyoKaZIH+uA1rrQqDjLk6EQZW65oVz1Y+BkC3V//9lEvKKjRZNb1Jg==", - "dependencies": { - "q": "^1.2.0" - }, - "bin": { - "markdown-include": "bin/cli.js" - } - }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -7144,15 +7132,6 @@ } ] }, - "node_modules/q": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", - "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", - "engines": { - "node": ">=0.6.0", - "teleport": ">=0.2.0" - } - }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -12894,14 +12873,6 @@ "tmpl": "1.0.5" } }, - "markdown-include": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/markdown-include/-/markdown-include-0.4.3.tgz", - "integrity": "sha512-kw1f+iJ8jAH9SYljv2RXmhRQFr2oMPPVdyoKaZIH+uA1rrQqDjLk6EQZW65oVz1Y+BkC3V//9lEvKKjRZNb1Jg==", - "requires": { - "q": "^1.2.0" - } - }, "merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -13432,11 +13403,6 @@ "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.4.tgz", "integrity": "sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA==" }, - "q": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", - "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=" - }, "queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", diff --git a/package.json b/package.json index a755815b..46dcb653 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,6 @@ "libxml2-wasm": "^0.5.0", "lodash": "^4.17.21", "luxon": "^3.3.0", - "markdown-include": "^0.4.3", "mockdate": "^3.0.5", "nedb-promises": "^6.0.3", "node-cleanup": "^2.1.2", diff --git a/scripts/commands/sites/update.ts b/scripts/commands/sites/update.ts index b9550550..4b587df4 100644 --- a/scripts/commands/sites/update.ts +++ b/scripts/commands/sites/update.ts @@ -1,51 +1,63 @@ +import { Channel } from 'epg-grabber' import { Logger, Storage, Collection } from '@freearhey/core' -import { IssueLoader, HTMLTable, Markdown } from '../../core' +import { IssueLoader, HTMLTable, ChannelsParser } from '../../core' import { Issue, Site } from '../../models' -import { SITES_DIR, DOT_SITES_DIR } from '../../constants' -import path from 'path' +import { SITES_DIR, ROOT_DIR } from '../../constants' async function main() { const logger = new Logger({ disabled: true }) const loader = new IssueLoader() - const storage = new Storage(SITES_DIR) + const sitesStorage = new Storage(SITES_DIR) + const channelsParser = new ChannelsParser({ storage: sitesStorage }) const sites = new Collection() logger.info('loading list of sites') - const folders = await storage.list('*/') + const folders = await sitesStorage.list('*/') logger.info('loading issues...') const issues = await loadIssues(loader) logger.info('putting the data together...') - folders.forEach((domain: string) => { + for (const domain of folders) { const filteredIssues = issues.filter((issue: Issue) => domain === issue.data.get('site')) const site = new Site({ domain, issues: filteredIssues }) + const files = await sitesStorage.list(`${domain}/*.channels.xml`) + for (const filepath of files) { + const channels = await channelsParser.parse(filepath) + + site.totalChannels += channels.count() + site.markedChannels += channels.filter((channel: Channel) => channel.xmltv_id).count() + } + sites.add(site) - }) + } logger.info('creating sites table...') const data = new Collection() sites.forEach((site: Site) => { data.add([ `${site.domain}`, + `${site.totalChannels} / ${site.markedChannels}`, site.getStatus().emoji, site.getIssues().all().join(', ') ]) }) - const table = new HTMLTable(data.all(), [{ name: 'Site' }, { name: 'Status' }, { name: 'Notes' }]) - - const readmeStorage = new Storage(DOT_SITES_DIR) - await readmeStorage.save('_table.md', table.toString()) - logger.info('updating sites.md...') - const configPath = path.join(DOT_SITES_DIR, 'config.json') - const sitesMarkdown = new Markdown(configPath) - sitesMarkdown.compile() + const table = new HTMLTable(data.all(), [ + { name: 'Site' }, + { name: 'Channels *', align: 'center' }, + { name: 'Status' }, + { name: 'Notes' } + ]) + const rootStorage = new Storage(ROOT_DIR) + const sitesTemplate = await new Storage().load('scripts/templates/_sites.md') + const sitesContent = sitesTemplate.replace('_TABLE_', table.toString()) + await rootStorage.save('SITES.md', sitesContent) } main() diff --git a/scripts/constants.ts b/scripts/constants.ts index e15b8b45..8af78b1d 100644 --- a/scripts/constants.ts +++ b/scripts/constants.ts @@ -1,3 +1,4 @@ +export const ROOT_DIR = process.env.ROOT_DIR || '.' export const SITES_DIR = process.env.SITES_DIR || './sites' export const GUIDES_DIR = process.env.GUIDES_DIR || './guides' export const DATA_DIR = process.env.DATA_DIR || './temp/data' diff --git a/scripts/core/index.ts b/scripts/core/index.ts index 14a0ffa0..2c7309ed 100644 --- a/scripts/core/index.ts +++ b/scripts/core/index.ts @@ -13,4 +13,3 @@ export * from './queueCreator' export * from './issueLoader' export * from './issueParser' export * from './htmlTable' -export * from './markdown' diff --git a/scripts/core/markdown.ts b/scripts/core/markdown.ts deleted file mode 100644 index 4efaddb0..00000000 --- a/scripts/core/markdown.ts +++ /dev/null @@ -1,13 +0,0 @@ -import markdownInclude from 'markdown-include' - -export class Markdown { - filepath: string - - constructor(filepath: string) { - this.filepath = filepath - } - - compile() { - markdownInclude.compileFiles(this.filepath) - } -} diff --git a/scripts/models/site.ts b/scripts/models/site.ts index 4fd5b33a..fa95165f 100644 --- a/scripts/models/site.ts +++ b/scripts/models/site.ts @@ -14,15 +14,21 @@ type Status = { type SiteProps = { domain: string + totalChannels?: number + markedChannels?: number issues: Collection } export class Site { domain: string + totalChannels: number + markedChannels: number issues: Collection - constructor({ domain, issues }: SiteProps) { + constructor({ domain, totalChannels = 0, markedChannels = 0, issues }: SiteProps) { this.domain = domain + this.totalChannels = totalChannels + this.markedChannels = markedChannels this.issues = issues } diff --git a/scripts/templates/_sites.md b/scripts/templates/_sites.md new file mode 100644 index 00000000..a4c4b906 --- /dev/null +++ b/scripts/templates/_sites.md @@ -0,0 +1,5 @@ +# Sites + +\* Total number of channels / with a valid `xmltv-id` + +_TABLE_ diff --git a/tests/__data__/expected/SITES.md b/tests/__data__/expected/SITES.md new file mode 100644 index 00000000..5f8597e3 --- /dev/null +++ b/tests/__data__/expected/SITES.md @@ -0,0 +1,14 @@ +# Sites + +\* Total number of channels / with a valid `xmltv-id` + +
SiteStatusNotes
SiteChannels *StatusNotes
9tv.co.il1 / 1🟢
abc.net.au540 / 55🟢
allente.dk74 / 44🟢
allente.fi71 / 25🟢
allente.no84 / 53🟢
allente.se92 / 92🟢
andorradifusio.ad1 / 1🟢
anteltv.com.uy53 / 47🟢
antennaeurope.gr1 / 1🟢
antennapacific.gr1 / 1🟢
antennasatellite.gr1 / 1🟢
arianaafgtv.com1 / 1🟢
arianatelevision.com1 / 1🟢
arirang.com3 / 3🟢
artonline.tv5 / 5🟢
awilime.com111 / 0🟢
bein.com160 / 160🟢
beinsports.com104 / 81🟢
berrymedia.co.kr5 / 5🟢
cablego.com.pe100 / 20🟢
cableplus.com.uy171 / 47🟢
canalplus.com11591 / 212🟢
cgates.lt102 / 61🟢
chada.ma1 / 1🟢
chaines-tv.orange.fr296 / 147🟢
clickthecity.com32 / 30🟢
content.astro.com.my157 / 112🟢
cosmotetv.gr108 / 0🟢
cubmu.com174 / 122🟢
cyta.com.cy116 / 0🟢
dens.tv67 / 64🟢
digea.gr92 / 0🟢
digiturk.com.tr108 / 107🟢
directv.com1043 / 698🔴https://github.com/iptv-org/epg/issues/2284
directv.com.ar412 / 229🔴https://github.com/iptv-org/epg/issues/2339
directv.com.uy143 / 142🟢
dishtv.in394 / 287🔴https://github.com/iptv-org/epg/issues/2445
dna.fi122 / 0🟢
dsmart.com.tr104 / 90🟢
dstv.com6983 / 181🟢
elcinema.com224 / 193🟢
ena.skylifetv.co.kr6 / 6🟢
energeek.cl6 / 3🟢
entertainment.ie109 / 95🟢
epg.112114.xyz930 / 1🟢
epg.iptvx.one2862 / 0🟢
epg.telemach.ba259 / 0🟢
epg.telemach.me216 / 0🟢
firstmedia.com116 / 101🟢
foxsports.com.au7 / 7🟢
foxtel.com.au155 / 87🟢
freeview.co.uk165 / 89🟢
frikanalen.no1 / 1🟢
galamtv.kz27 / 22🟢
gatotv.com475 / 362🟢
getafteritmedia.com5 / 5🟢
gigatv.3bbtv.co.th79 / 38🟢
guiadetv.com124 / 0🟢
guida.tv88 / 88🟢
guidatv.sky.it168 / 153🟢
horizon.tv184 / 172🟢
hoy.tv3 / 1🟢
i.mjh.nz6458 / 1488🟢
i24news.tv4 / 3🟢
iltalehti.fi142 / 44🟢
indihometv.com130 / 124🟢
ionplustv.com1 / 1🟢
ipko.tv194 / 152🟢
jiotv.com1094 / 0🟢
kan.org.il3 / 3🔴https://github.com/iptv-org/epg/issues/2273
knr.gl1 / 1🟢
kvf.fo1 / 1🟢
m.tv.sms.cz1027 / 451🟢
m.tving.com30 / 26🟢
magticom.ge240 / 110🟢
mako.co.il1 / 1🟢
maxtvgo.mk110 / 48🟢
mediagenie.co.kr5 / 4🟢
mediaklikk.hu8 / 8🟢
mediasetinfinity.mediaset.it13 / 13🟢
melita.com127 / 111🟢
meo.pt216 / 127🟢
meuguia.tv102 / 97🟢
mewatch.sg25 / 24🟢
mi.tv2084 / 620🟢
mncvision.id276 / 223🟢
moji.id1 / 1🟢
mojmaxtv.hrvatskitelekom.hr243 / 0🟢
mon-programme-tv.be111 / 95🟢
movistarplus.es178 / 0🟢
mtel.ba417 / 220🟢
mts.rs457 / 0🟢
mujtvprogram.cz216 / 203🟢
musor.tv181 / 146🟢
mysky.com.ph115 / 43🟢
mytelly.co.uk488 / 401🟢
mytvsuper.com108 / 99🟢
neo.io337 / 241🟢
nhkworldpremium.com2 / 2🟢
nhl.com1 / 1🟢
nostv.pt168 / 141🟢
novacyprus.com29 / 24🟢
novasports.gr16 / 16🟢
nowplayer.now.com288 / 229🟢
nuevosiglo.com.uy173 / 47🟢
nzxmltv.com532 / 118🟢
ontvtonight.com5177 / 532🟢
opto.sic.pt4 / 2🟢
orangetv.orange.es168 / 165🟢
osn.com118 / 98🟢
pbsguam.org1 / 1🟢
pickx.be378 / 332🟢
player.ee.co.uk241 / 206🟢
playtv.unifi.com.my66 / 61🟢
plex.tv170 / 119🟢
pluto.tv3302 / 0🟢
programacion-tv.elpais.com195 / 105🟢
programacion.tcc.com.uy149 / 56🟢
programetv.ro331 / 225🟢
programme-tv.net295 / 197🟢
programme-tv.vini.pf58 / 2🟢
programme.tvb.com8 / 6🟢
programtv.onet.pl589 / 315🟢
raiplay.it17 / 13🟢
reportv.com.ar163 / 97🟢
rikstv.no80 / 0🟢
rotana.net32 / 28🟢
rtb.gov.bn3 / 3🔴https://github.com/iptv-org/epg/issues/2257
rthk.hk8 / 8🟢
rtmklik.rtm.gov.my8 / 6🟢
rtp.pt10 / 10🟢
ruv.is2 / 2🟢
s.mxtv.jp2 / 2🟢
sat.tv31173 / 277🟢
shahid.mbc.net306 / 120🟢
siba.com.co98 / 96🟢
singtel.com155 / 113🟢
sjonvarp.is13 / 13🟢
sky.co.nz111 / 93🟢
sky.com532 / 433🟢
sky.de75 / 75🟢
skylife.co.kr251 / 0🟢
skyperfectv.co.jp137 / 130🟢
snrt.ma11 / 5🟢
sporttv.pt9 / 8🟢
starhubtvplus.com232 / 208🟢
startimestv.com77 / 58🟢
stod2.is12 / 8🟢
streamingtvguides.com3066 / 1🟢
superguidatv.it204 / 163🟢
taiwanplus.com1 / 1🟢
tapdmv.com39 / 7🟢
telebilbao.es1 / 1🟢
telenet.tv260 / 91🟢
teliatv.ee342 / 233🟢
telkussa.fi66 / 32🟢
telsu.fi17 / 15🟢
thesportplus.com3 / 0🟢
tivie.id50 / 49🟢
tivu.tv69 / 66🟢
toonamiaftermath.com1 / 1🟢
turksatkablo.com.tr175 / 167🟢
tv-programme.telecablesat.fr268 / 250🟢
tv-spored.siol.net312 / 0🟢
tv.blue.ch1030 / 565🟢
tv.cctv.com94 / 88🟢
tv.dir.bg111 / 96🟢
tv.lv137 / 49🟢
tv.magenta.at307 / 228🟢
tv.mail.ru664 / 644🟢
tv.movistar.com.pe282 / 40🟢
tv.nu199 / 181🟢
tv.post.lu332 / 242🟢
tv.sfr.fr503 / 0🟢
tv.trueid.net266 / 74🟢
tv.yandex.ru97 / 67🟢
tv24.co.uk119 / 45🟢
tv24.se326 / 157🟢
tv2go.t-2.net335 / 254🟢
tvarenasport.com14 / 12🟢
tvarenasport.hr10 / 10🟢
tvcesoir.fr135 / 133🟢
tvcubana.icrt.cu10 / 10🟢
tvgids.nl115 / 90🟢
tvguide.com153 / 150🟢
tvguide.myjcom.jp145 / 140🟢
tvhebdo.com317 / 215🟢
tvheute.at53 / 53🟢
tvim.tv25 / 19🟢
tvinsider.com374 / 0🟢
tvireland.ie334 / 304🟢
tvmi.mt3 / 3🟢
tvmusor.hu99 / 68🟢
tvmustra.hu188 / 0🟢
tvpassport.com19287 / 0🟢
tvplus.com.tr143 / 134🟢
tvprofil.com5836 / 457🟢
tvtv.us2299 / 2256🟢
v3.myafn.dodmedia.osd.mil8 / 8🟢
vidio.com47 / 46🟢
virginmediatelevision.ie5 / 5🟢
virgintvgo.virginmedia.com238 / 195🟢
visionplus.id250 / 226🟢
vivoplay.com.br389 / 0🟢
vtm.be7 / 6🟢
walesi.com.fj9 / 8🟢
watch.sportsnet.ca8 / 8🟢
watchyour.tv40 / 24🟢
wavve.com77 / 76🟢
web.magentatv.de348 / 247🟢
webtv.delta.nl247 / 218🟢
winplay.co2 / 2🟢
worldfishingnetwork.com1 / 1🟢
www3.nhk.or.jp1 / 1🟢
xem.kplus.vn77 / 0🟢
xumo.tv350 / 32🟢
zap.co.ao114 / 64🟢
ziggogo.tv152 / 130🟢
znbc.co.zm4 / 4🟢
zuragt.mn36 / 25🟢
9tv.co.il🟢
abc.net.au🟢
allente.dk🟢
+ + + + + + + + +
SiteChannels *StatusNotes
iltalehti.fi142 / 44🟡https://github.com/iptv-org/epg/issues/2396
indihometv.com130 / 124🟢
kan.org.il6 / 6🔴https://github.com/iptv-org/epg/issues/2273
diff --git a/tests/__data__/expected/_sites.md b/tests/__data__/expected/_sites.md deleted file mode 100644 index bd63aa62..00000000 --- a/tests/__data__/expected/_sites.md +++ /dev/null @@ -1,13 +0,0 @@ -# Sites - - - - - - - - - - - -
SiteStatusNotes
iltalehti.fi🟡https://github.com/iptv-org/epg/issues/2396
indihometv.com🟢
kan.org.il🔴https://github.com/iptv-org/epg/issues/2273
diff --git a/tests/__data__/input/.sites/config.json b/tests/__data__/input/.sites/config.json deleted file mode 100644 index 2574a566..00000000 --- a/tests/__data__/input/.sites/config.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "build" : "tests/__data__/output/sites.md", - "files" : ["tests/__data__/output/.sites/template.md"] -} \ No newline at end of file diff --git a/tests/__data__/input/.sites/template.md b/tests/__data__/input/.sites/template.md deleted file mode 100644 index c630b91b..00000000 --- a/tests/__data__/input/.sites/template.md +++ /dev/null @@ -1,4 +0,0 @@ -# Sites - - -#include "tests/__data__/output/.sites/_table.md" diff --git a/tests/__data__/input/sites-update/sites/iltalehti.fi/iltalehti.fi.channels.xml b/tests/__data__/input/sites-update/sites/iltalehti.fi/iltalehti.fi.channels.xml new file mode 100644 index 00000000..253417a5 --- /dev/null +++ b/tests/__data__/input/sites-update/sites/iltalehti.fi/iltalehti.fi.channels.xml @@ -0,0 +1,145 @@ + + + Viron ETV + National Geographic + Disney Channel + Disney Junior + Nat Geo Wild Scandinavia + V sport 1 Suomi + V sport 2 Suomi + Viasat Nature/Crime + V sport + V sport + Suomi + V Sport Live 1 + V Sport Live 2 + V Sport Live 3 + V Sport Live 4 + V Sport Live 5 + Discovery Science + The History Channel + Investigation Discovery + Nat Geo Wild Scandinavia + National Geographic + Travel Channel + Viasat Explore + Viasat History + Viasat Nature/Crime + Barnkanalen + Cartoon Network + Cartoonito + Disney Channel + Disney Junior + MTV juniori + Nick Jr. + V film FAMILY + iConcerts + Club MTV + MTV Finland + MTV Live HD + VH1 Classic + Al Jazeera + BBC World News + Bloomberg TV + CNBC + CNN + Deutsche Welle + EuroNews + Sky News + MTV Ava + Fashion TV + Food Network + Frii + Liv + TLC + Travel Channel + V film FAMILY + V film HITS + BBC Nordic + RTL + TV Finland + TV5 Monde + Barnkanalen + SF-kanalen + MTV Urheilu 3 + MTV Aitio + MTV Viihde + V film PREMIERE + V film ACTION + V film FAMILY + V film HITS + Eurosport + Eurosport 2 + MTV Liiga 1 + MTV Liiga 2 + MTV Liiga 3 + MTV Liiga 4 + MTV Liiga 5 + MTV Liiga 6 + MTV Liiga 7 + MTV Liiga UHD + MTV Max + MTV Urheilu 1 + MTV Urheilu 2 + MTV Urheilu 3 + V sport FOOTBALL + V sport GOLF + V sport vinter + V sport 1 Suomi + V sport 2 Suomi + V sport + V sport PREMIUM + V sport + Suomi + V Sport Live 1 + V Sport Live 2 + V Sport Live 3 + V Sport Live 4 + V Sport Live 5 + Animal Planet + MTV Ava + Cartoon Network + MTV juniori + MTV Max + MTV Urheilu 1 + MTV Urheilu 2 + Discovery Channel + Extreme Sports + Star + Frii + Hero + Himlen TV7 + Jim + Kanal5 + Kutonen + Liv + MTV3 + MTV Aitio + MTV Viihde + National Geographic + Nelonen + SF-kanalen + MTV Sub + SVT 1 + SVT 2 + SVT24 + TV7 + TLC + TV3 + TV4 + TV5 + TV6 + V film ACTION + V film FAMILY + V film HITS + V film PREMIERE + Viasat Explore + Viasat History + H2 + V sport FOOTBALL + V sport GOLF + V sport PREMIUM + V sport ULTRA HD + V sport vinter + Yle Teema Fem + Yle TV1 + Yle TV2 + \ No newline at end of file diff --git a/tests/__data__/input/sites-update/sites/indihometv.com/indihometv.com.channels.xml b/tests/__data__/input/sites-update/sites/indihometv.com/indihometv.com.channels.xml new file mode 100644 index 00000000..6eb233d8 --- /dev/null +++ b/tests/__data__/input/sites-update/sites/indihometv.com/indihometv.com.channels.xml @@ -0,0 +1,133 @@ + + + ABC Australia + Aljazeera + Animal Planet + Animax + Aniplus + Antara + ANTV + Arirang + Asian Food Network + ATV + AXN + Bali TV + Bioskop Indonesia + Bloomberg + BTV + Cartoonito + Cartoon Network + CCTV4 + Celestial Movie + CGTN Documentary + Chinese Drama + Cinema World + Citra Dangdut + Citra Drama + News Asia + CNBC Asia + CNBC Indonesia + CNN Indonesia + CNN International + Crime Investigation + Curiosity + Daai TV + Da Vinci Learning + Discovery Asia + Discovery Channel + Dreamworks + Dunia anak + Dunia Lain + DW (English) + Eat & Go + Euronews + FashionTV + Fight Sport + Flik + France 24 + Galaxy + Galaxy Premium + HGTV + History + Hits + HIts Movie + HITS Now + Horee + Horizon Sports + I-Konser + IDTV + IDX + IMC + FunPlanet + Indonesiana TV + Indosiar + iNews + JakTV + Jawa Pos TV + JTV + KBS World + Kix + Kompas TV + Kplus + Lifetime + Lingua + Love Nature + Maxstream + Mentari TV + Metro TV + MOJI + Moonbug + MQTV + MTATV + MTV Live + Musik Indonesia + MyKidz + NBA + Net. + New Tv Comprehensive + New Tv Finance + New Tv Variety + nhk world Japan + Nickelodeon + Nick Junior + Insert + Nusantara TV + SONE + Phoenix Chinese + Phoenix InfoNews + Prambors + AlQuran Kareem + Rajawali TV + Rock Entertainment + Rock Action + Rodja TV + RRI NET + SCTV + SEA Today + Seru! + Shenzen + SINDO News TV + SPOTV 2 + SPOTV + Studio Universal + Tawaf TV + Tech Storm + Thrill + TLC + Trans7 + TransTV + TV5Monde + TV9 NU + TVBS News + Muhammadiyah TV + MUI TV + TVN + TVN Movies + TV One + TVRI + UChannel + AllPlay Ent + Warner + ZBioskop + Zhejiang + diff --git a/tests/__data__/input/sites-update/sites/kan.org.il/kan.org.il_1.channels.xml b/tests/__data__/input/sites-update/sites/kan.org.il/kan.org.il_1.channels.xml new file mode 100644 index 00000000..c89752bc --- /dev/null +++ b/tests/__data__/input/sites-update/sites/kan.org.il/kan.org.il_1.channels.xml @@ -0,0 +1,6 @@ + + + مكان + כאן 11 + חינוכית + diff --git a/tests/__data__/input/sites-update/sites/kan.org.il/kan.org.il_2.channels.xml b/tests/__data__/input/sites-update/sites/kan.org.il/kan.org.il_2.channels.xml new file mode 100644 index 00000000..c89752bc --- /dev/null +++ b/tests/__data__/input/sites-update/sites/kan.org.il/kan.org.il_2.channels.xml @@ -0,0 +1,6 @@ + + + مكان + כאן 11 + חינוכית + diff --git a/tests/commands/sites/update.test.ts b/tests/commands/sites/update.test.ts index 0af18d4c..c14a7370 100644 --- a/tests/commands/sites/update.test.ts +++ b/tests/commands/sites/update.test.ts @@ -3,24 +3,14 @@ import fs from 'fs-extra' import { pathToFileURL } from 'node:url' import os from 'os' -let ENV_VAR = - 'DOT_SITES_DIR=tests/__data__/output/.sites SITES_DIR=tests/__data__/input/sites-update/sites' +let ENV_VAR = 'SITES_DIR=tests/__data__/input/sites-update/sites ROOT_DIR=tests/__data__/output' if (os.platform() === 'win32') { ENV_VAR = - 'SET "DOT_SITES_DIR=tests/__data__/output/.sites" && SET "SITES_DIR=tests/__data__/input/sites-update/sites" &&' + 'SET "SITES_DIR=tests/__data__/input/sites-update/sites" && SET "ROOT_DIR=tests/__data__/output" &&' } beforeEach(() => { fs.emptyDirSync('tests/__data__/output') - fs.mkdirSync('tests/__data__/output/.sites') - fs.copyFileSync( - 'tests/__data__/input/.sites/config.json', - 'tests/__data__/output/.sites/config.json' - ) - fs.copyFileSync( - 'tests/__data__/input/.sites/template.md', - 'tests/__data__/output/.sites/template.md' - ) }) it('can update SITES.md', () => { @@ -29,11 +19,9 @@ it('can update SITES.md', () => { const stdout = execSync(cmd, { encoding: 'utf8' }) if (process.env.DEBUG === 'true') console.log(cmd, stdout) - expect(content('tests/__data__/output/sites.md')).toEqual( - content('tests/__data__/expected/_sites.md') + expect(content('tests/__data__/output/SITES.md')).toEqual( + content('tests/__data__/expected/SITES.md') ) - - expect(true).toBe(true) }) function content(filepath: string) { diff --git a/yarn.lock b/yarn.lock index b715fa72..1ba3d3bd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3600,13 +3600,6 @@ makeerror@1.0.12: dependencies: tmpl "1.0.5" -markdown-include@^0.4.3: - version "0.4.3" - resolved "https://registry.npmjs.org/markdown-include/-/markdown-include-0.4.3.tgz" - integrity sha512-kw1f+iJ8jAH9SYljv2RXmhRQFr2oMPPVdyoKaZIH+uA1rrQqDjLk6EQZW65oVz1Y+BkC3V//9lEvKKjRZNb1Jg== - dependencies: - q "^1.2.0" - merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz" @@ -4109,11 +4102,6 @@ pure-rand@^6.0.0: resolved "https://registry.npmjs.org/pure-rand/-/pure-rand-6.0.4.tgz" integrity sha512-LA0Y9kxMYv47GIPJy6MI84fqTd2HmYZI83W/kM/SkKfDlajnZYfmXFTxkbY+xSBPkLJxltMa9hIkmdc29eguMA== -q@^1.2.0: - version "1.5.1" - resolved "https://registry.npmjs.org/q/-/q-1.5.1.tgz" - integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc= - queue-microtask@^1.2.2: version "1.2.3" resolved "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz"