Replaced langs package with iso-639-3
This commit is contained in:
parent
e9efc5b5f9
commit
4e4b9ea77a
|
@ -80,10 +80,10 @@
|
||||||
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
|
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"langs": {
|
"iso-639-3": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/langs/-/langs-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/iso-639-3/-/iso-639-3-2.0.0.tgz",
|
||||||
"integrity": "sha1-AMMs5IFSpJphRFC5uiYyq1igo2Q=",
|
"integrity": "sha512-Pp+ctEs/pna6/rj05a5VR3qYxJHBZi95wp20C6Snf/WeghrkR/4G44LPJFqlbyo67XntkcUaxwrGmMeyY+F4mA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"markdown-include": {
|
"markdown-include": {
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
"escape-string-regexp": "^2.0.0",
|
"escape-string-regexp": "^2.0.0",
|
||||||
"fluent-ffmpeg": "^2.1.2",
|
"fluent-ffmpeg": "^2.1.2",
|
||||||
"iptv-playlist-parser": "^0.4.0",
|
"iptv-playlist-parser": "^0.4.0",
|
||||||
"langs": "^2.0.0",
|
"markdown-include": "^0.4.3",
|
||||||
"markdown-include": "^0.4.3"
|
"iso-639-3": "^2.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,9 +5,9 @@ const axios = require('axios')
|
||||||
const zlib = require('zlib')
|
const zlib = require('zlib')
|
||||||
const epgParser = require('epg-parser')
|
const epgParser = require('epg-parser')
|
||||||
const urlParser = require('url')
|
const urlParser = require('url')
|
||||||
const langs = require('langs')
|
|
||||||
const escapeStringRegexp = require('escape-string-regexp')
|
const escapeStringRegexp = require('escape-string-regexp')
|
||||||
const markdownInclude = require('markdown-include')
|
const markdownInclude = require('markdown-include')
|
||||||
|
const iso6393 = require('iso-639-3')
|
||||||
|
|
||||||
let cache = {}
|
let cache = {}
|
||||||
let helper = {}
|
let helper = {}
|
||||||
|
@ -41,11 +41,15 @@ helper.escapeStringRegexp = function (scring) {
|
||||||
}
|
}
|
||||||
|
|
||||||
helper.getISO6391Name = function (code) {
|
helper.getISO6391Name = function (code) {
|
||||||
return langs.has('3', code) ? langs.where('3', code).name : null
|
const lang = iso6393.find((l) => l.iso6393 === code.toLowerCase())
|
||||||
|
|
||||||
|
return lang && lang.name ? lang.name : null
|
||||||
}
|
}
|
||||||
|
|
||||||
helper.getISO6391Code = function (name) {
|
helper.getISO6391Code = function (name) {
|
||||||
return langs.has('name', name) ? langs.where('name', name)['3'] : null
|
const lang = iso6393.find((l) => l.name === name)
|
||||||
|
|
||||||
|
return lang && lang.iso6393 ? lang.iso6393 : null
|
||||||
}
|
}
|
||||||
|
|
||||||
helper.parsePlaylist = function (filename) {
|
helper.parsePlaylist = function (filename) {
|
||||||
|
|
Loading…
Reference in New Issue