Update update-playlists.js
This commit is contained in:
parent
f81108040a
commit
10971f3751
|
@ -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'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue