mirror of
https://github.com/Dispatcharr/Dispatcharr.git
synced 2026-01-23 10:45:27 +00:00
Sort guide by channel number.
This commit is contained in:
parent
0ff84457de
commit
d72a08c9de
1 changed files with 5 additions and 3 deletions
|
|
@ -64,9 +64,11 @@ export default function TVChannelGuide({ startDate, endDate }) {
|
|||
const programIds = [...new Set(fetched.map((p) => p.tvg_id))];
|
||||
|
||||
// Filter your Redux/Zustand channels by matching tvg_id
|
||||
const filteredChannels = Object.values(channels).filter((ch) =>
|
||||
programIds.includes(ch.epg_data?.tvg_id)
|
||||
);
|
||||
const filteredChannels = Object.values(channels)
|
||||
.filter((ch) => programIds.includes(ch.epg_data?.tvg_id))
|
||||
// Add sorting by channel_number
|
||||
.sort((a, b) => (a.channel_number || Infinity) - (b.channel_number || Infinity));
|
||||
|
||||
console.log(
|
||||
`found ${filteredChannels.length} channels with matching tvg_ids`
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue