(w http.ResponseWriter, r *http.Request)
| 1434 | } |
| 1435 | |
| 1436 | func disablePPV(w http.ResponseWriter, r *http.Request) { |
| 1437 | xepg, err := loadJSONFileToMap(System.File.XEPG) |
| 1438 | if err != nil { |
| 1439 | var response APIResponseStruct |
| 1440 | |
| 1441 | response.Status = false |
| 1442 | response.Error = err.Error() |
| 1443 | w.Write([]byte(mapToJSON(response))) |
| 1444 | } |
| 1445 | |
| 1446 | for _, c := range xepg { |
| 1447 | |
| 1448 | var xepgChannel = c.(map[string]interface{}) |
| 1449 | |
| 1450 | if xepgChannel["x-mapping"] == "PPV" && xepgChannel["x-active"] == true { |
| 1451 | xepgChannel["x-active"] = false |
| 1452 | } |
| 1453 | } |
| 1454 | |
| 1455 | err = saveMapToJSONFile(System.File.XEPG, xepg) |
| 1456 | if err != nil { |
| 1457 | var response APIResponseStruct |
| 1458 | |
| 1459 | response.Status = false |
| 1460 | response.Error = err.Error() |
| 1461 | w.Write([]byte(mapToJSON(response))) |
| 1462 | } |
| 1463 | buildXEPG() |
| 1464 | |
| 1465 | w.Header().Set("Content-Type", "application/json") |
| 1466 | w.WriteHeader(200) |
| 1467 | } |
| 1468 | |
| 1469 | func httpStatusError(w http.ResponseWriter, r *http.Request, httpStatusCode int) { |
| 1470 | http.Error(w, fmt.Sprintf("%s [%d]", http.StatusText(httpStatusCode), httpStatusCode), httpStatusCode) |
nothing calls this directly
no test coverage detected