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

Function createSearchObj

ts/base_ts.ts:401–454  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

399}
400
401function createSearchObj() {
402
403 SEARCH_MAPPING = new Object()
404
405 // Safety check: ensure SERVER.xepg and epgMapping exist
406 if (!SERVER || !SERVER["xepg"] || !SERVER["xepg"]["epgMapping"]) {
407 console.log("createSearchObj: XEPG data not yet available, skipping search object creation");
408 return;
409 }
410
411 var data = SERVER["xepg"]["epgMapping"]
412 var channels = getObjKeys(data)
413
414 var channelKeys: string[] = ["x-active", "x-channelID", "x-name", "_file.m3u.name", "x-group-title", "x-xmltv-file"]
415
416 channels.forEach(id => {
417
418 channelKeys.forEach(key => {
419
420 if (key == "x-active") {
421
422 switch (data[id][key]) {
423 case true:
424 SEARCH_MAPPING[id] = "online "
425 break;
426
427 case false:
428 SEARCH_MAPPING[id] = "offline "
429 break;
430
431 }
432
433 } else {
434
435 if (key == "x-xmltv-file") {
436 var xmltvFile = getValueFromProviderFile(data[id][key], "xmltv", "name")
437
438 if (xmltvFile != undefined) {
439 SEARCH_MAPPING[id] = SEARCH_MAPPING[id] + xmltvFile + " "
440 }
441
442 } else {
443 SEARCH_MAPPING[id] = SEARCH_MAPPING[id] + data[id][key] + " "
444 }
445
446
447 }
448
449 })
450
451 })
452
453 return
454}
455
456function enableGroupSelection(selector) {
457 var lastcheck = null // no checkboxes clicked yet

Callers 3

createTableContentMethod · 0.70
donePopupDataFunction · 0.70

Calls 2

getObjKeysFunction · 0.70
getValueFromProviderFileFunction · 0.70

Tested by

no test coverage detected