Added movies overview page. Fixed channel filter duplicates.

This commit is contained in:
2024-02-27 01:20:15 +01:00
parent ae36a951a0
commit f29246050b
25 changed files with 993 additions and 48 deletions

View File

@@ -118,8 +118,8 @@ const entities = computed(() => {
|| (channel.parent && searchRegexp.value.test(channel.parent.name))
|| (channel.parent && searchRegexp.value.test(channel.parent.slug))));
return Object.values(filteredChannels.reduce((acc, channel) => {
if (!channel.parent || channel.isIndependent) {
const networks = Object.values(filteredChannels.reduce((acc, channel) => {
if (!acc[channel.id] && (channel.type === 'network' || !channel.parent || channel.isIndependent)) { // network may have already been created by a child
acc[channel.id] = {
...channel,
children: [],
@@ -128,14 +128,16 @@ const entities = computed(() => {
return acc;
}
if (!acc[channel.parent.id]) {
if (!acc[channel.parent.id] && channel.type === 'channel') {
acc[channel.parent.id] = {
...channel.parent,
children: [],
};
}
acc[channel.parent.id].children.push(channel);
if (channel.type === 'channel') {
acc[channel.parent.id].children.push(channel);
}
return acc;
}, {}))
@@ -146,6 +148,8 @@ const entities = computed(() => {
}))
.sort(sort)
.flatMap((network) => [network, ...(network.children || [])]);
return networks;
});
</script>