Move sort operation to separate file
This commit is contained in:
@@ -15,7 +15,6 @@ async function main() {
|
||||
.parsePlaylist(playlist.url)
|
||||
.then(removeWrongCategories)
|
||||
.then(addMissingData)
|
||||
.then(sortChannels)
|
||||
.then(playlist => {
|
||||
if (file.read(playlist.url) !== playlist.toString()) {
|
||||
log.print('updated')
|
||||
@@ -65,12 +64,4 @@ async function addMissingData(playlist) {
|
||||
return playlist
|
||||
}
|
||||
|
||||
async function sortChannels(playlist) {
|
||||
const channels = [...playlist.channels]
|
||||
utils.sortBy(channels, ['name', 'url'])
|
||||
playlist.channels = channels
|
||||
|
||||
return playlist
|
||||
}
|
||||
|
||||
main()
|
||||
|
Reference in New Issue
Block a user