MCPcopy Index your code
hub / github.com/Threadfin/Threadfin / changeXmltvFile

Function changeXmltvFile

html/js/mapping-editor.js:1084–1153  ·  view source on GitHub ↗
(xepg, elm)

Source from the content-addressed store, hash-verified

1082}
1083
1084function changeXmltvFile(xepg, elm) {
1085
1086 var thisChannel = xEPG["epgMapping"][xepg];
1087
1088 var xXmltvFile = elm.value;
1089 var channelID = thisChannel["tvg-id"];
1090 thisChannel["x-xmltv-file"] = xXmltvFile;
1091
1092 if (bulk == false) {
1093
1094 setTimeout(function () {
1095
1096 var xMapping = "-"
1097
1098 // Automap
1099 if (xXmltvFile != "-") {
1100 if (xEPG["xmltvMap"][xXmltvFile].hasOwnProperty(channelID) == true) {
1101 thisChannel["x-mapping"] = channelID;
1102 xMapping = channelID
1103 } else {
1104 thisChannel["x-mapping"] = xMapping
1105 }
1106 } else {
1107 thisChannel["x-mapping"] = xMapping
1108
1109 }
1110
1111 var tr = document.getElementById(xepg);
1112
1113 if (xMapping == "-") {
1114 thisChannel["x-active"] = false;
1115 tr.className = "notActiveEPG"
1116 } else {
1117 thisChannel["x-active"] = true;
1118 tr.className = "activeEPG"
1119 }
1120
1121 // Show data in table
1122 var td = tr.getElementsByTagName("TD");
1123 var dataFile = td[td.length - 2].lastChild;
1124 switch (xXmltvFile) {
1125 case "-": dataFile.innerHTML = xXmltvFile; break;
1126 case "Threadfin Dummy": dataFile.innerHTML = xXmltvFile; break;
1127 default: dataFile.innerHTML = getValueFromProviderFile(xXmltvFile, "xmltv", "name"); break;
1128 }
1129
1130 //xXmltvFile.replace(/^.*[\\\/]/, '');
1131
1132 var dataXmltvID = td[td.length - 1].lastChild;
1133 dataXmltvID.innerHTML = xMapping;
1134
1135 mappingDetail(xepg);
1136
1137 }, 10);
1138 }
1139
1140 if (bulk == true) {
1141 var key = "x-xmltv-file"

Callers

nothing calls this directly

Calls 3

mappingDetailFunction · 0.85
saveBulkFunction · 0.85
getValueFromProviderFileFunction · 0.70

Tested by

no test coverage detected