mirror of
https://github.com/iptv-org/epg
synced 2025-12-19 03:46:41 -05:00
Update update.js
This commit is contained in:
@@ -12,8 +12,8 @@ const options = program
|
|||||||
async function main() {
|
async function main() {
|
||||||
await api.countries.load().catch(console.error)
|
await api.countries.load().catch(console.error)
|
||||||
const logPath = `${LOGS_DIR}/guides/update.log`
|
const logPath = `${LOGS_DIR}/guides/update.log`
|
||||||
const results = await parser.parseLogs(logPath)
|
let results = await parser.parseLogs(logPath)
|
||||||
const files = results.reduce((acc, curr) => {
|
let files = results.reduce((acc, curr) => {
|
||||||
if (acc[curr.filename]) {
|
if (acc[curr.filename]) {
|
||||||
acc[curr.filename].channels++
|
acc[curr.filename].channels++
|
||||||
} else {
|
} else {
|
||||||
@@ -41,7 +41,11 @@ async function main() {
|
|||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
data = _.orderBy(data, [item => item[0], item => item[2]], ['asc', 'desc'])
|
data = _.orderBy(
|
||||||
|
data,
|
||||||
|
[item => item[0], item => (item[3].includes('_en') ? Infinity : item[2])],
|
||||||
|
['asc', 'desc']
|
||||||
|
)
|
||||||
data = data.map(i => {
|
data = data.map(i => {
|
||||||
i.shift()
|
i.shift()
|
||||||
return i
|
return i
|
||||||
|
|||||||
Reference in New Issue
Block a user