diff --git a/src/_data/freetubeCategories.js b/src/_data/freetubeCategories.js index a6a95d1..3fe5ac4 100644 --- a/src/_data/freetubeCategories.js +++ b/src/_data/freetubeCategories.js @@ -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]) });