MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / getCurrentPrograms

Function getCurrentPrograms

frontend/src/utils/pages/StatsUtils.js:23–46  ·  view source on GitHub ↗
(activeChannelUUIDs)

Source from the content-addressed store, hash-verified

21};
22
23export const getCurrentPrograms = async (activeChannelUUIDs) => {
24 try {
25 if (!activeChannelUUIDs || activeChannelUUIDs.length === 0) {
26 return {};
27 }
28
29 const programs = await API.getCurrentPrograms(activeChannelUUIDs);
30
31 // Convert array to map keyed by channel UUID for easy lookup
32 const programsMap = {};
33 if (programs && Array.isArray(programs)) {
34 programs.forEach((program) => {
35 if (program.channel_uuid) {
36 programsMap[program.channel_uuid] = program;
37 }
38 });
39 }
40
41 return programsMap;
42 } catch (error) {
43 console.error('Error fetching current programs:', error);
44 return {};
45 }
46};
47
48export const getCombinedConnections = (channelHistory, vodConnections) => {
49 const activeStreams = Object.values(channelHistory).map((channel) => ({

Callers 1

fetchProgramsFunction · 0.90

Calls 1

getCurrentProgramsMethod · 0.80

Tested by

no test coverage detected