From 5b50b72fd17959918d78b8e688e3e24d4bf4d1ef Mon Sep 17 00:00:00 2001 From: freearhey Date: Fri, 1 Nov 2019 11:34:06 +0300 Subject: [PATCH] Sort playlists by language name --- README.md | 2 +- helpers/generate.js | 11 ++++++++++- helpers/languages.md | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 85ca4f2ac..633c152e4 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Or select one of the playlists from the list below. ## Playlists by language -
LanguageChannelsPlaylist
Albanian6https://iptv-org.github.io/iptv/languages/sq.m3u
English178https://iptv-org.github.io/iptv/languages/en.m3u
Dutch7https://iptv-org.github.io/iptv/languages/nl.m3u
Serbian5https://iptv-org.github.io/iptv/languages/sr.m3u
Croatian2https://iptv-org.github.io/iptv/languages/hr.m3u
Portuguese51https://iptv-org.github.io/iptv/languages/pt.m3u
Bulgarian7https://iptv-org.github.io/iptv/languages/bg.m3u
Chinese839https://iptv-org.github.io/iptv/languages/zh.m3u
Greek11https://iptv-org.github.io/iptv/languages/el.m3u
Czech16https://iptv-org.github.io/iptv/languages/cs.m3u
Danish8https://iptv-org.github.io/iptv/languages/da.m3u
Arabic20https://iptv-org.github.io/iptv/languages/ar.m3u
Estonian9https://iptv-org.github.io/iptv/languages/et.m3u
Finnish2https://iptv-org.github.io/iptv/languages/fi.m3u
Persian4https://iptv-org.github.io/iptv/languages/fa.m3u
Hebrew10https://iptv-org.github.io/iptv/languages/he.m3u
Maltese2https://iptv-org.github.io/iptv/languages/mt.m3u
Norwegian Bokmål1https://iptv-org.github.io/iptv/languages/nb.m3u
Spanish26https://iptv-org.github.io/iptv/languages/es.m3u
Turkish39https://iptv-org.github.io/iptv/languages/tr.m3u
Undefined5448https://iptv-org.github.io/iptv/languages/undefined.m3u
+
LanguageChannelsPlaylist
Albanian6https://iptv-org.github.io/iptv/languages/sq.m3u
Arabic20https://iptv-org.github.io/iptv/languages/ar.m3u
Bulgarian7https://iptv-org.github.io/iptv/languages/bg.m3u
Chinese839https://iptv-org.github.io/iptv/languages/zh.m3u
Croatian2https://iptv-org.github.io/iptv/languages/hr.m3u
Czech16https://iptv-org.github.io/iptv/languages/cs.m3u
Danish8https://iptv-org.github.io/iptv/languages/da.m3u
Dutch7https://iptv-org.github.io/iptv/languages/nl.m3u
English178https://iptv-org.github.io/iptv/languages/en.m3u
Estonian9https://iptv-org.github.io/iptv/languages/et.m3u
Finnish2https://iptv-org.github.io/iptv/languages/fi.m3u
Greek11https://iptv-org.github.io/iptv/languages/el.m3u
Hebrew10https://iptv-org.github.io/iptv/languages/he.m3u
Maltese2https://iptv-org.github.io/iptv/languages/mt.m3u
Norwegian Bokmål1https://iptv-org.github.io/iptv/languages/nb.m3u
Persian4https://iptv-org.github.io/iptv/languages/fa.m3u
Portuguese51https://iptv-org.github.io/iptv/languages/pt.m3u
Serbian5https://iptv-org.github.io/iptv/languages/sr.m3u
Spanish26https://iptv-org.github.io/iptv/languages/es.m3u
Turkish39https://iptv-org.github.io/iptv/languages/tr.m3u
Undefined5448https://iptv-org.github.io/iptv/languages/undefined.m3u
## Playlists by country diff --git a/helpers/generate.js b/helpers/generate.js index d49359501..7587ed10f 100644 --- a/helpers/generate.js +++ b/helpers/generate.js @@ -138,7 +138,16 @@ function main() { } } - const languagesTable = util.generateTable(Object.values(repo.languages), { + const languages = Object.values(repo.languages) + const lastRow = languages.splice(languages.length - 1, 1)[0] + languages.sort((a, b) => { + if(a.language < b.language) { return -1 } + if(a.language > b.language) { return 1 } + return 0 + }) + languages.push(lastRow) + + const languagesTable = util.generateTable(languages, { columns: [ { name: 'Language', align: 'left' }, { name: 'Channels', align: 'right' }, diff --git a/helpers/languages.md b/helpers/languages.md index 393f70d76..64f8cd82a 100644 --- a/helpers/languages.md +++ b/helpers/languages.md @@ -1 +1 @@ -
LanguageChannelsPlaylist
Albanian6https://iptv-org.github.io/iptv/languages/sq.m3u
English178https://iptv-org.github.io/iptv/languages/en.m3u
Dutch7https://iptv-org.github.io/iptv/languages/nl.m3u
Serbian5https://iptv-org.github.io/iptv/languages/sr.m3u
Croatian2https://iptv-org.github.io/iptv/languages/hr.m3u
Portuguese51https://iptv-org.github.io/iptv/languages/pt.m3u
Bulgarian7https://iptv-org.github.io/iptv/languages/bg.m3u
Chinese839https://iptv-org.github.io/iptv/languages/zh.m3u
Greek11https://iptv-org.github.io/iptv/languages/el.m3u
Czech16https://iptv-org.github.io/iptv/languages/cs.m3u
Danish8https://iptv-org.github.io/iptv/languages/da.m3u
Arabic20https://iptv-org.github.io/iptv/languages/ar.m3u
Estonian9https://iptv-org.github.io/iptv/languages/et.m3u
Finnish2https://iptv-org.github.io/iptv/languages/fi.m3u
Persian4https://iptv-org.github.io/iptv/languages/fa.m3u
Hebrew10https://iptv-org.github.io/iptv/languages/he.m3u
Maltese2https://iptv-org.github.io/iptv/languages/mt.m3u
Norwegian Bokmål1https://iptv-org.github.io/iptv/languages/nb.m3u
Spanish26https://iptv-org.github.io/iptv/languages/es.m3u
Turkish39https://iptv-org.github.io/iptv/languages/tr.m3u
Undefined5448https://iptv-org.github.io/iptv/languages/undefined.m3u
\ No newline at end of file +
LanguageChannelsPlaylist
Albanian6https://iptv-org.github.io/iptv/languages/sq.m3u
Arabic20https://iptv-org.github.io/iptv/languages/ar.m3u
Bulgarian7https://iptv-org.github.io/iptv/languages/bg.m3u
Chinese839https://iptv-org.github.io/iptv/languages/zh.m3u
Croatian2https://iptv-org.github.io/iptv/languages/hr.m3u
Czech16https://iptv-org.github.io/iptv/languages/cs.m3u
Danish8https://iptv-org.github.io/iptv/languages/da.m3u
Dutch7https://iptv-org.github.io/iptv/languages/nl.m3u
English178https://iptv-org.github.io/iptv/languages/en.m3u
Estonian9https://iptv-org.github.io/iptv/languages/et.m3u
Finnish2https://iptv-org.github.io/iptv/languages/fi.m3u
Greek11https://iptv-org.github.io/iptv/languages/el.m3u
Hebrew10https://iptv-org.github.io/iptv/languages/he.m3u
Maltese2https://iptv-org.github.io/iptv/languages/mt.m3u
Norwegian Bokmål1https://iptv-org.github.io/iptv/languages/nb.m3u
Persian4https://iptv-org.github.io/iptv/languages/fa.m3u
Portuguese51https://iptv-org.github.io/iptv/languages/pt.m3u
Serbian5https://iptv-org.github.io/iptv/languages/sr.m3u
Spanish26https://iptv-org.github.io/iptv/languages/es.m3u
Turkish39https://iptv-org.github.io/iptv/languages/tr.m3u
Undefined5448https://iptv-org.github.io/iptv/languages/undefined.m3u
\ No newline at end of file