Merge remote-tracking branch 'origin/master' into feature-webapp
# Conflicts: # src/web/WebApp.kt
This commit is contained in:
@@ -260,7 +260,7 @@ class MainExtension01 {
|
||||
val value = variables["AL"].orEmpty()
|
||||
if (ValidString(value)) {
|
||||
val airplane =
|
||||
sb.firstOrNull { it.Category == Category.Airline_Name.name && it.TAG == value }
|
||||
sb.firstOrNull { it.Category == Category.Airplane_Name.name && it.TAG == value }
|
||||
if (airplane != null) {
|
||||
if (ValidFile(airplane.Path)) {
|
||||
files.add(airplane.Path)
|
||||
@@ -588,11 +588,12 @@ class MainExtension01 {
|
||||
Logger.info { logmessage }
|
||||
db.Add_Log("AAS", logmessage)
|
||||
db.queuepagingDB.DeleteByIndex(qp.index.toInt())
|
||||
|
||||
db.queuepagingDB.Resort()
|
||||
return true
|
||||
} else {
|
||||
// file tidak valid, delete from queue paging
|
||||
db.queuepagingDB.DeleteByIndex(qp.index.toInt())
|
||||
db.queuepagingDB.Resort()
|
||||
db.Add_Log(
|
||||
"AAS",
|
||||
"Cancelled paging message with index ${qp.index} due to invalid audio file"
|
||||
@@ -602,11 +603,13 @@ class MainExtension01 {
|
||||
} else {
|
||||
// ada broadcast zone yang tidak valid, delete from queue paging
|
||||
db.queuepagingDB.DeleteByIndex(qp.index.toInt())
|
||||
db.queuepagingDB.Resort()
|
||||
db.Add_Log("AAS", "Cancelled paging message with index ${qp.index} due to invalid broadcast zone")
|
||||
}
|
||||
} else {
|
||||
// file tidak valid, delete from queue paging
|
||||
db.queuepagingDB.DeleteByIndex(qp.index.toInt())
|
||||
db.queuepagingDB.Resort()
|
||||
db.Add_Log(
|
||||
"AAS",
|
||||
"Cancelled paging message with index ${qp.index} due to invalid audio file"
|
||||
@@ -615,6 +618,7 @@ class MainExtension01 {
|
||||
} else {
|
||||
// invalid broadcast zone, delete from queue paging
|
||||
db.queuepagingDB.DeleteByIndex(qp.index.toInt())
|
||||
db.queuepagingDB.Resort()
|
||||
db.Add_Log("AAS", "Cancelled paging message with index ${qp.index} due to empty broadcast zone")
|
||||
}
|
||||
}
|
||||
@@ -688,6 +692,7 @@ class MainExtension01 {
|
||||
Logger.info { logmsg }
|
||||
db.Add_Log("AAS", logmsg)
|
||||
db.queuepagingDB.DeleteByIndex(qp.index.toInt())
|
||||
db.queuepagingDB.Resort()
|
||||
return true
|
||||
} else {
|
||||
db.Add_Log(
|
||||
@@ -698,6 +703,7 @@ class MainExtension01 {
|
||||
}
|
||||
} else{
|
||||
db.queuepagingDB.DeleteByIndex(qp.index.toInt())
|
||||
db.queuepagingDB.Resort()
|
||||
db.Add_Log("AAS", result.message)
|
||||
}
|
||||
}
|
||||
@@ -706,6 +712,7 @@ class MainExtension01 {
|
||||
} else {
|
||||
// tidak ada messagebank dengan ann_id ini, delete from queue paging
|
||||
db.queuepagingDB.DeleteByIndex(qp.index.toInt())
|
||||
db.queuepagingDB.Resort()
|
||||
db.Add_Log(
|
||||
"AAS",
|
||||
"Cancelled Shalat message with index ${qp.index} due to ANN_ID $ann_id not found in Messagebank"
|
||||
@@ -716,16 +723,19 @@ class MainExtension01 {
|
||||
} else {
|
||||
// invalid ann_id, delete from queue paging
|
||||
db.queuepagingDB.DeleteByIndex(qp.index.toInt())
|
||||
db.queuepagingDB.Resort()
|
||||
db.Add_Log("AAS", "Cancelled shalat message with index ${qp.index} due to invalid ANN_ID")
|
||||
}
|
||||
} else {
|
||||
// ada broadcast zone yang tidak valid, delete from queue paging
|
||||
db.queuepagingDB.DeleteByIndex(qp.index.toInt())
|
||||
db.queuepagingDB.Resort()
|
||||
db.Add_Log("AAS", "Cancelled shalat message with index ${qp.index} due to invalid broadcast zone")
|
||||
}
|
||||
} else {
|
||||
// invalid broadcast zone, delete from queue paging
|
||||
db.queuepagingDB.DeleteByIndex(qp.index.toInt())
|
||||
db.queuepagingDB.Resort()
|
||||
db.Add_Log("AAS", "Cancelled shalat message with index ${qp.index} due to empty broadcast zone")
|
||||
}
|
||||
}
|
||||
@@ -789,14 +799,17 @@ class MainExtension01 {
|
||||
Logger.info { logmsg }
|
||||
db.Add_Log("AAS", logmsg)
|
||||
db.queuetableDB.DeleteByIndex(qa.index.toInt())
|
||||
db.queuetableDB.Resort()
|
||||
return true
|
||||
}
|
||||
} else{
|
||||
db.queuetableDB.DeleteByIndex(qa.index.toInt())
|
||||
db.queuetableDB.Resort()
|
||||
db.Add_Log("AAS", result.message)
|
||||
}
|
||||
} else {
|
||||
db.queuetableDB.DeleteByIndex(qa.index.toInt())
|
||||
db.queuetableDB.Resort()
|
||||
db.Add_Log("AAS", result.message)
|
||||
}
|
||||
|
||||
@@ -805,6 +818,7 @@ class MainExtension01 {
|
||||
} else {
|
||||
// tidak ada messagebank dengan ann_id ini, delete from queue table
|
||||
db.queuetableDB.DeleteByIndex(qa.index.toInt())
|
||||
db.queuetableDB.Resort()
|
||||
db.Add_Log(
|
||||
"AAS",
|
||||
"Cancelled TIMER with index ${qa.index} due to ANN_ID $ann_id not found in Messagebank"
|
||||
@@ -815,16 +829,19 @@ class MainExtension01 {
|
||||
} else {
|
||||
// invalid ann_id, delete from queue table
|
||||
db.queuetableDB.DeleteByIndex(qa.index.toInt())
|
||||
db.queuetableDB.Resort()
|
||||
db.Add_Log("AAS", "Cancelled TIMER message with index ${qa.index} due to invalid ANN_ID")
|
||||
}
|
||||
} else {
|
||||
// ada broadcast zone yang tidak valid, delete from queue table
|
||||
db.queuetableDB.DeleteByIndex(qa.index.toInt())
|
||||
db.queuetableDB.Resort()
|
||||
db.Add_Log("AAS", "Cancelled TIMER message with index ${qa.index} due to invalid broadcast zone")
|
||||
}
|
||||
} else {
|
||||
// invalid broadcast zone, delete from queue table
|
||||
db.queuetableDB.DeleteByIndex(qa.index.toInt())
|
||||
db.queuetableDB.Resort()
|
||||
db.Add_Log("AAS", "Cancelled TIMER message with index ${qa.index} due to empty broadcast zone")
|
||||
}
|
||||
}
|
||||
@@ -903,6 +920,7 @@ class MainExtension01 {
|
||||
"Cancelled SOUNDBANK message with index ${qa.index} due to missing or invalid ANN_ID in SB_TAGS"
|
||||
)
|
||||
db.queuetableDB.DeleteByIndex(qa.index.toInt())
|
||||
db.queuetableDB.Resort()
|
||||
return@forEach
|
||||
}
|
||||
// sampe sini punya ann_id valid
|
||||
@@ -930,12 +948,14 @@ class MainExtension01 {
|
||||
} else {
|
||||
db.Add_Log("AAS", result.message)
|
||||
db.queuetableDB.DeleteByIndex(qa.index.toInt())
|
||||
db.queuetableDB.Resort()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (listafi.isNotEmpty()){
|
||||
db.queuetableDB.DeleteByIndex(qa.index.toInt())
|
||||
db.queuetableDB.Resort()
|
||||
// bikin nama file ada postifx nya dari SB_TAGS, tapi spasi diganti underscore
|
||||
// dan titik dua diganti dash
|
||||
val postfix = qa.SB_TAGS.replace(" ","_").replace(":","-")
|
||||
@@ -972,6 +992,7 @@ class MainExtension01 {
|
||||
} else {
|
||||
println("Failed to write WAV file: ${result.message}")
|
||||
db.queuetableDB.DeleteByIndex(qa.index.toInt())
|
||||
db.queuetableDB.Resort()
|
||||
db.Add_Log("AAS", result.message)
|
||||
}
|
||||
|
||||
@@ -979,6 +1000,7 @@ class MainExtension01 {
|
||||
} else {
|
||||
// tidak ada messagebank dengan ann_id ini, delete from queue table
|
||||
db.queuetableDB.DeleteByIndex(qa.index.toInt())
|
||||
db.queuetableDB.Resort()
|
||||
db.Add_Log(
|
||||
"AAS",
|
||||
"Cancelled SOUNDBANK message with index ${qa.index} due to ANN_ID $ann_id not found in Messagebank"
|
||||
@@ -990,11 +1012,13 @@ class MainExtension01 {
|
||||
} else {
|
||||
// ada broadcast zone yang tidak valid, delete from queue table
|
||||
db.queuetableDB.DeleteByIndex(qa.index.toInt())
|
||||
db.queuetableDB.Resort()
|
||||
db.Add_Log("AAS", "Cancelled SOUNDBANK message with index ${qa.index} due to invalid broadcast zone")
|
||||
}
|
||||
} else {
|
||||
// invalid broadcast zone, delete from queue table
|
||||
db.queuetableDB.DeleteByIndex(qa.index.toInt())
|
||||
db.queuetableDB.Resort()
|
||||
db.Add_Log("AAS", "Cancelled SOUNDBANK message with index ${qa.index} due to empty broadcast zone")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,11 +111,13 @@ class BarixConnection(val index: UInt, var channel: String, val ipaddress: Strin
|
||||
try {
|
||||
val chunk = ByteArray(if (bb.remaining() > maxUDPsize) maxUDPsize else bb.remaining())
|
||||
bb.get(chunk)
|
||||
//println("Buffer remain: $bufferRemain, sending chunk size: ${chunk.size}")
|
||||
while(bufferRemain<chunk.size){
|
||||
delay(10)
|
||||
//println("Waiting until buffer enough..")
|
||||
}
|
||||
udp.send(DatagramPacket(chunk, chunk.size, inet))
|
||||
delay(1)
|
||||
delay(2)
|
||||
} catch (e: Exception) {
|
||||
cbFail.accept("SendData to $ipaddress:$port failed, message: ${e.message}")
|
||||
return@launch
|
||||
|
||||
@@ -37,8 +37,10 @@ class TCP_Barix_Command_Server {
|
||||
val key : String = socket.inetAddress.hostAddress
|
||||
socketMap[key] = socket
|
||||
Logger.info { "Start communicating with Streamer Output with IP : $key" }
|
||||
try{
|
||||
val din = socket.getInputStream()
|
||||
while (isActive) {
|
||||
|
||||
if (din.available()>0){
|
||||
val bb = ByteArray(din.available())
|
||||
din.read(bb)
|
||||
@@ -62,6 +64,10 @@ class TCP_Barix_Command_Server {
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (ex:Exception){
|
||||
Logger.error { "Error in communication with Streamer Output with IP $key, Message : ${ex.message}" }
|
||||
}
|
||||
|
||||
Logger.info { "Finished communicating with Streamer Output with IP $key" }
|
||||
socketMap.remove(key)
|
||||
|
||||
|
||||
@@ -220,6 +220,7 @@ class TCP_Android_Command_Server {
|
||||
pj.broadcastzones
|
||||
)
|
||||
if (db.queuepagingDB.Add(qp)) {
|
||||
db.queuepagingDB.Resort()
|
||||
logcb.accept("Paging audio inserted to queue paging table from Android $key, file ${pj.filePath.absolutePathString()}")
|
||||
cb.accept("PCMFILE_STOP;OK@")
|
||||
return
|
||||
@@ -274,6 +275,7 @@ class TCP_Android_Command_Server {
|
||||
pj.broadcastzones
|
||||
)
|
||||
if (db.queuepagingDB.Add(qp)){
|
||||
db.queuepagingDB.Resort()
|
||||
logcb.accept("Paging audio inserted to queue paging table from IPM $key, file ${pj.filePath.absolutePathString()}")
|
||||
cb.accept("STOPPAGINGAND;OK@")
|
||||
return
|
||||
@@ -349,7 +351,7 @@ class TCP_Android_Command_Server {
|
||||
.filter { it.isNotBlank() }
|
||||
.forEach { al ->
|
||||
val sb = db.soundDB.List
|
||||
.filter { it.Category.equals(Category.Airline_Name.name, true) }
|
||||
.filter { it.Category.equals(Category.Airplane_Name.name, true) }
|
||||
.filter { it.TAG.equals(al, true)}
|
||||
.distinctBy { it.TAG }
|
||||
VARAPTOTAL.addAll(sb)
|
||||
@@ -627,6 +629,7 @@ class TCP_Android_Command_Server {
|
||||
lang
|
||||
)
|
||||
if (db.queuetableDB.Add(qt)){
|
||||
db.queuetableDB.Resort()
|
||||
logcb.accept("Broadcast request from Android $key username=${listUserLogin.find { it.ip==key }?.username ?: "UNKNOWN"} inserted. Message: $desc;$lang;$tags;$zone")
|
||||
cb.accept("BROADCASTAND;OK@")
|
||||
return
|
||||
|
||||
@@ -3,7 +3,7 @@ package content
|
||||
@Suppress("unused")
|
||||
enum class Category(name: String) {
|
||||
Airline_Code("Airline_Code"),
|
||||
Airline_Name("Airline_Name"),
|
||||
Airplane_Name("Airplane_Name"),
|
||||
AlphabetNumeric("AlphabetNumeric"),
|
||||
City("City"),
|
||||
Phrase("Phrase"),
|
||||
|
||||
@@ -2280,7 +2280,7 @@ class MariaDB(
|
||||
|
||||
fun Find_Soundbank_AirplaneName(tag: String) : List<Soundbank>{
|
||||
return soundDB.List
|
||||
.filter{ it.Category== Category.Airline_Name.name }
|
||||
.filter{ it.Category== Category.Airplane_Name.name }
|
||||
.filter { it.TAG.equals(tag,true)}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,10 +19,11 @@ import database.BroadcastZones
|
||||
import database.LanguageLink
|
||||
import database.MariaDB
|
||||
import database.Messagebank
|
||||
import database.ScheduleBank
|
||||
import database.SoundChannel
|
||||
import database.Soundbank
|
||||
import database.UserDB
|
||||
import database.ScheduleBank
|
||||
>>>>>>>>> Temporary merge branch 2
|
||||
import db
|
||||
import io.javalin.Javalin
|
||||
import io.javalin.apibuilder.ApiBuilder.before
|
||||
@@ -236,7 +237,7 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>) {
|
||||
}
|
||||
get("AirlineTags") { ctx ->
|
||||
val value = db.soundDB.List
|
||||
.filter { it.Category == Category.Airline_Name.name }
|
||||
.filter { it.Category == Category.Airplane_Name.name }
|
||||
.distinctBy { it.TAG }
|
||||
.sortedBy { it.TAG }
|
||||
.map { KeyValueMessage(it.TAG, it.Description) }
|
||||
@@ -266,32 +267,20 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>) {
|
||||
if (ValidFile(addvalue.Path)) {
|
||||
if (db.soundDB.Add(addvalue)) {
|
||||
db.soundDB.Resort()
|
||||
it.result(
|
||||
objectmapper.writeValueAsString(
|
||||
resultMessage(
|
||||
"OK"
|
||||
)
|
||||
)
|
||||
)
|
||||
it.result(objectmapper.writeValueAsString(resultMessage("OK")))
|
||||
} else it.status(500)
|
||||
.result(objectmapper.writeValueAsString(resultMessage("Failed to add soundbank to database")))
|
||||
} else it.status(400)
|
||||
.result(objectmapper.writeValueAsString(resultMessage("Invalid Path, file does not exist")))
|
||||
} else it.status(400)
|
||||
.result(objectmapper.writeValueAsString(resultMessage("TAG=${addvalue.TAG} already exists for the same Language=${addvalue.Language} and Category=${addvalue.Category}")))
|
||||
} else it.status(400)
|
||||
.result(objectmapper.writeValueAsString(resultMessage("Invalid Path")))
|
||||
} else it.status(400)
|
||||
.result(objectmapper.writeValueAsString(resultMessage("Invalid Language")))
|
||||
} else it.status(400)
|
||||
.result(objectmapper.writeValueAsString(resultMessage("Invalid Category")))
|
||||
} else it.status(400)
|
||||
.result(objectmapper.writeValueAsString(resultMessage("Invalid TAG")))
|
||||
} else it.status(400)
|
||||
.result(objectmapper.writeValueAsString(resultMessage("Invalid Description")))
|
||||
} else it.status(400).result(objectmapper.writeValueAsString(resultMessage("Invalid Path")))
|
||||
} else it.status(400).result(objectmapper.writeValueAsString(resultMessage("Invalid Language")))
|
||||
} else it.status(400).result(objectmapper.writeValueAsString(resultMessage("Invalid Category")))
|
||||
} else it.status(400).result(objectmapper.writeValueAsString(resultMessage("Invalid TAG")))
|
||||
} else it.status(400).result(objectmapper.writeValueAsString(resultMessage("Invalid Description")))
|
||||
} catch (_: Exception) {
|
||||
it.status(400)
|
||||
.result(objectmapper.writeValueAsString(resultMessage("Invalid request body")))
|
||||
it.status(400).result(objectmapper.writeValueAsString(resultMessage("Invalid request body")))
|
||||
}
|
||||
}
|
||||
delete("List") {
|
||||
@@ -300,8 +289,7 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>) {
|
||||
db.soundDB.Get()
|
||||
it.result(objectmapper.writeValueAsString(resultMessage("OK")))
|
||||
} else {
|
||||
it.status(500)
|
||||
.result(objectmapper.writeValueAsString(resultMessage("Failed to truncate soundbank table")))
|
||||
it.status(500).result(objectmapper.writeValueAsString(resultMessage("Failed to truncate soundbank table")))
|
||||
}
|
||||
}
|
||||
delete("DeleteByIndex/{index}") {
|
||||
@@ -314,8 +302,7 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>) {
|
||||
db.soundDB.Resort()
|
||||
it.result(objectmapper.writeValueAsString(resultMessage("OK")))
|
||||
} else {
|
||||
it.status(500)
|
||||
.result(objectmapper.writeValueAsString(resultMessage("Failed to delete soundbank with index $index")))
|
||||
it.status(500).result(objectmapper.writeValueAsString(resultMessage("Failed to delete soundbank with index $index")))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -329,14 +316,12 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>) {
|
||||
val sb = db.soundDB.List.find { xx -> xx.index == index }
|
||||
if (sb == null) {
|
||||
// soundbank dengan index tersebut tidak ditemukan
|
||||
it.status(404)
|
||||
.result(objectmapper.writeValueAsString(resultMessage("Soundbank with index $index not found")))
|
||||
it.status(404).result(objectmapper.writeValueAsString(resultMessage("Soundbank with index $index not found")))
|
||||
} else {
|
||||
// soundbank dengan index tersebut ditemukan, sekarang update
|
||||
val json: JsonNode = objectmapper.readTree(it.body())
|
||||
if (json.isEmpty) {
|
||||
it.status(400)
|
||||
.result(objectmapper.writeValueAsString(resultMessage("UpdateByIndex with index=$index has empty body")))
|
||||
it.status(400).result(objectmapper.writeValueAsString(resultMessage("UpdateByIndex with index=$index has empty body")))
|
||||
} else {
|
||||
val _description = json.get("Description").asText("")
|
||||
val _tag = json.get("TAG").asText("")
|
||||
@@ -359,8 +344,7 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>) {
|
||||
sb.Category = _category
|
||||
changed = true
|
||||
} else {
|
||||
it.status(400)
|
||||
.result(objectmapper.writeValueAsString(resultMessage("Invalid Category")))
|
||||
it.status(400).result(objectmapper.writeValueAsString(resultMessage("Invalid Category")))
|
||||
return@patch
|
||||
}
|
||||
}
|
||||
@@ -373,8 +357,7 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>) {
|
||||
sb.Path = _path
|
||||
changed = true
|
||||
} else {
|
||||
it.status(400)
|
||||
.result(objectmapper.writeValueAsString(resultMessage("Invalid Path, file does not exist")))
|
||||
it.status(400).result(objectmapper.writeValueAsString(resultMessage("Invalid Path, file does not exist")))
|
||||
return@patch
|
||||
}
|
||||
}
|
||||
@@ -382,8 +365,7 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>) {
|
||||
if (db.soundDB.UpdateByIndex(index.toInt(), sb)) {
|
||||
db.soundDB.Resort()
|
||||
it.result(objectmapper.writeValueAsString(resultMessage("OK")))
|
||||
} else it.status(500)
|
||||
.result(objectmapper.writeValueAsString(resultMessage("Failed to update soundbank with index $index")))
|
||||
} else it.status(500).result(objectmapper.writeValueAsString(resultMessage("Failed to update soundbank with index $index")))
|
||||
} else it.status(400)
|
||||
.result(objectmapper.writeValueAsString(resultMessage("Nothing has changed for soundbank with index $index")))
|
||||
}
|
||||
@@ -402,15 +384,13 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>) {
|
||||
xlsxdata.write(out)
|
||||
}
|
||||
} else {
|
||||
it.status(500)
|
||||
.result(objectmapper.writeValueAsString(resultMessage("Failed to export soundbank to XLSX")))
|
||||
it.status(500).result(objectmapper.writeValueAsString(resultMessage("Failed to export soundbank to XLSX")))
|
||||
}
|
||||
}
|
||||
post("ImportXLSX") {
|
||||
val uploaded = it.uploadedFile("file")
|
||||
if (uploaded == null) {
|
||||
it.status(400)
|
||||
.result(objectmapper.writeValueAsString(resultMessage("No file uploaded")))
|
||||
it.status(400).result(objectmapper.writeValueAsString(resultMessage("No file uploaded")))
|
||||
return@post
|
||||
}
|
||||
try {
|
||||
@@ -419,12 +399,10 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>) {
|
||||
db.soundDB.Resort()
|
||||
it.result(objectmapper.writeValueAsString(resultMessage("OK")))
|
||||
} else {
|
||||
it.status(500)
|
||||
.result(objectmapper.writeValueAsString(resultMessage("Failed to import soundbank from XLSX")))
|
||||
it.status(500).result(objectmapper.writeValueAsString(resultMessage("Failed to import soundbank from XLSX")))
|
||||
}
|
||||
} catch (e: Exception) {
|
||||
it.status(400)
|
||||
.result(objectmapper.writeValueAsString(resultMessage("Invalid XLSX file")))
|
||||
it.status(400).result(objectmapper.writeValueAsString(resultMessage("Invalid XLSX file")))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -713,7 +691,6 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>) {
|
||||
// get timer list
|
||||
it.result(MariaDB.ArrayListtoString(db.scheduleDB.List))
|
||||
}
|
||||
|
||||
delete("List") {
|
||||
// truncate timer table
|
||||
if (db.scheduleDB.Clear()) {
|
||||
@@ -744,7 +721,17 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>) {
|
||||
val zones = broadcast_zones.split(";")
|
||||
if (zones.all { zz -> db.broadcastDB.List.any { xx -> xx.description.equals(zz,true) } }){
|
||||
if (ValidString(language) && Language.entries.any{ lang -> lang.name == language }){
|
||||
val newvalue = ScheduleBank(0u, description, day, time, soundpath, repeat, enable, broadcast_zones, language)
|
||||
val newvalue = ScheduleBank(
|
||||
0u,
|
||||
description,
|
||||
day,
|
||||
time,
|
||||
soundpath,
|
||||
repeat,
|
||||
enable,
|
||||
broadcast_zones,
|
||||
language
|
||||
)
|
||||
if (db.scheduleDB.Add(newvalue)){
|
||||
db.scheduleDB.Resort()
|
||||
it.result(objectmapper.writeValueAsString(resultMessage("OK")))
|
||||
@@ -1231,6 +1218,7 @@ class WebApp(val listenPort: Int, val userlist: List<Pair<String, String>>) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Steph : coba tambah untuk QueueTable Table. Belum ada di JS file(?)
|
||||
path("QueueTable"){
|
||||
|
||||
|
||||
Reference in New Issue
Block a user