()
| 305 | return; |
| 306 | } |
| 307 | function createSearchObj() { |
| 308 | SEARCH_MAPPING = new Object(); |
| 309 | // Safety check: ensure SERVER.xepg and epgMapping exist |
| 310 | if (!SERVER || !SERVER["xepg"] || !SERVER["xepg"]["epgMapping"]) { |
| 311 | console.log("createSearchObj: XEPG data not yet available, skipping search object creation"); |
| 312 | return; |
| 313 | } |
| 314 | var data = SERVER["xepg"]["epgMapping"]; |
| 315 | var channels = getObjKeys(data); |
| 316 | var channelKeys = ["x-active", "x-channelID", "x-name", "_file.m3u.name", "x-group-title", "x-xmltv-file"]; |
| 317 | channels.forEach(id => { |
| 318 | channelKeys.forEach(key => { |
| 319 | if (key == "x-active") { |
| 320 | switch (data[id][key]) { |
| 321 | case true: |
| 322 | SEARCH_MAPPING[id] = "online "; |
| 323 | break; |
| 324 | case false: |
| 325 | SEARCH_MAPPING[id] = "offline "; |
| 326 | break; |
| 327 | } |
| 328 | } |
| 329 | else { |
| 330 | if (key == "x-xmltv-file") { |
| 331 | var xmltvFile = getValueFromProviderFile(data[id][key], "xmltv", "name"); |
| 332 | if (xmltvFile != undefined) { |
| 333 | SEARCH_MAPPING[id] = SEARCH_MAPPING[id] + xmltvFile + " "; |
| 334 | } |
| 335 | } |
| 336 | else { |
| 337 | SEARCH_MAPPING[id] = SEARCH_MAPPING[id] + data[id][key] + " "; |
| 338 | } |
| 339 | } |
| 340 | }); |
| 341 | }); |
| 342 | return; |
| 343 | } |
| 344 | function enableGroupSelection(selector) { |
| 345 | var lastcheck = null; // no checkboxes clicked yet |
| 346 | // get desired checkboxes |
no test coverage detected