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:
Devon Campbell 2024-11-22 12:32:44 -05:00
commit f665396d55

View file

@ -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));
sortedCategories.push(othersCategory);
// Subscriptions are sorted alphabetically.
sortedCategories.forEach(category => {
category.subscriptions.sort((a, b) => a.name.localeCompare(b.name));
});
sortedCategories.forEach(category => {
category.subscriptions?.forEach(channel => channel.tags = subscriptionTags[channel.id])
});