feat: add settings option to hide Live TV categories (#11)
Add a liveChannelListMode setting (default 'grouped') with a Settings toggle to display the Live TV channel list flat, without category group sections. When enabled, logical channels are listed directly with their stream variants still grouped as in #9/#10. Cover the setting default and flat-list behavior with tests. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -152,11 +152,24 @@
|
||||
}).filter(channel => showHidden || !channel.isHidden);
|
||||
}
|
||||
|
||||
function orderFlatChannels(channels) {
|
||||
return channels.map((channel, index) => ({ channel, index })).sort((a, b) => {
|
||||
const favoriteDifference = Number(b.channel.isFavorite) - Number(a.channel.isFavorite);
|
||||
return favoriteDifference || a.index - b.index;
|
||||
}).map(entry => entry.channel);
|
||||
}
|
||||
|
||||
function shouldUseFavoritesGroup(listMode) {
|
||||
return listMode === 'grouped';
|
||||
}
|
||||
|
||||
return {
|
||||
normalizeChannelName,
|
||||
displayNameForFingerprint,
|
||||
getVariantKey,
|
||||
getQuality,
|
||||
groupChannels
|
||||
groupChannels,
|
||||
orderFlatChannels,
|
||||
shouldUseFavoritesGroup
|
||||
};
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user