MCPcopy Create free account
hub / github.com/Threadfin/Threadfin / setXmltvChannel

Function setXmltvChannel

ts/menu_ts.ts:2372–2397  ·  view source on GitHub ↗
(epgMapId: string, xmlTvFileSelect: HTMLSelectElement)

Source from the content-addressed store, hash-verified

2370}
2371
2372function setXmltvChannel(epgMapId: string, xmlTvFileSelect: HTMLSelectElement) {
2373
2374 const xmlTv = new XMLTVFile();
2375 const newXmlTvFile = xmlTvFileSelect.value;
2376
2377 // Remove old XMLTV ID selection box
2378 const xmlTvIdPickerParent = document.getElementById('xmltv-id-picker-container').parentElement as HTMLTableCellElement;
2379 xmlTvIdPickerParent.innerHTML = '';
2380
2381 // Create new XMLTV ID selection box
2382 const tvgId: string = SERVER['xepg']['epgMapping'][epgMapId]['tvg-id'];
2383
2384 const [xmlTvIdContainer, xmlTvIdInput, xmlTvIdDatalist] = xmlTv.newXmlTvIdPicker(newXmlTvFile, tvgId);
2385 xmlTvIdContainer.setAttribute('id', 'xmltv-id-picker-container');
2386 xmlTvIdInput.setAttribute('list', 'xmltv-id-picker-datalist');
2387 xmlTvIdInput.setAttribute('name', 'x-mapping'); // Should stay x-mapping as it will be used in donePopupData to make a server request
2388 xmlTvIdInput.setAttribute('id', 'xmltv-id-picker-input');
2389 xmlTvIdInput.setAttribute('onchange', `javascript: this.className = 'changed'; checkXmltvChannel('${epgMapId}', this.value, '${newXmlTvFile}');`);
2390 xmlTvIdInput.classList.add('changed');
2391 xmlTvIdDatalist.setAttribute('id', 'xmltv-id-picker-datalist');
2392
2393 // Add new XMLTV ID selection box to it's parent
2394 xmlTvIdPickerParent.appendChild(xmlTvIdContainer);
2395
2396 checkXmltvChannel(epgMapId, xmlTvIdInput.value, newXmlTvFile);
2397}
2398
2399function checkPPV(title, element) {
2400 var value = (element as HTMLSelectElement).value

Callers

nothing calls this directly

Calls 2

newXmlTvIdPickerMethod · 0.95
checkXmltvChannelFunction · 0.70

Tested by

no test coverage detected