mirror of
https://github.com/iptv-org/iptv
synced 2026-10-26 21:08:28 -04:00
Update update-playlists.js
This commit is contained in:
1 parent
1e7c2b6580
commit
9c61136d9d
1 file changed
+9
-1
@@ -10,10 +10,18 @@ async function main() {
|
|||||||
const files = _.groupBy(items, 'filepath')
|
const files = _.groupBy(items, 'filepath')
|
||||||
|
|
||||||
for (const filepath in files) {
|
for (const filepath in files) {
|
||||||
const items = files[filepath]
|
let items = files[filepath]
|
||||||
|
items = items.sort(naturalOrder)
|
||||||
const playlist = createPlaylist(items, { public: false })
|
const playlist = createPlaylist(items, { public: false })
|
||||||
await file.create(filepath, playlist.toString())
|
await file.create(filepath, playlist.toString())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
main()
|
main()
|
||||||
|
|
||||||
|
function naturalOrder(a, b) {
|
||||||
|
return a.channel_name.localeCompare(b.channel_name, undefined, {
|
||||||
|
numeric: true,
|
||||||
|
sensitivity: 'base'
|
||||||
|
})
|
||||||
|
}
|
||||||
Reference in new issue
Block a user