Sort channel names
I thought the channel names were already sorted in the source data file, but it turns out they aren't. I now sort them after sorting the category names.
This commit is contained in:
parent
fc92223b23
commit
f665396d55
1 changed files with 6 additions and 1 deletions
|
|
@ -108,10 +108,15 @@ module.exports = async function getSubscriptions() {
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
// Categories are sorted alphabetically. Subscriptions are already alphabetized in the incoming data.
|
// Categories are sorted alphabetically.
|
||||||
const sortedCategories = categories.sort((a, b) => a.name.localeCompare(b.name));
|
const sortedCategories = categories.sort((a, b) => a.name.localeCompare(b.name));
|
||||||
sortedCategories.push(othersCategory);
|
sortedCategories.push(othersCategory);
|
||||||
|
|
||||||
|
// Subscriptions are sorted alphabetically.
|
||||||
|
sortedCategories.forEach(category => {
|
||||||
|
category.subscriptions.sort((a, b) => a.name.localeCompare(b.name));
|
||||||
|
});
|
||||||
|
|
||||||
sortedCategories.forEach(category => {
|
sortedCategories.forEach(category => {
|
||||||
category.subscriptions?.forEach(channel => channel.tags = subscriptionTags[channel.id])
|
category.subscriptions?.forEach(channel => channel.tags = subscriptionTags[channel.id])
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue