Commit 30/09/2025
This commit is contained in:
@@ -39,7 +39,7 @@ class MainExtension01 {
|
||||
val validchannels = bz
|
||||
// check apakah tiap zone ada di database broadcast zones
|
||||
.filter { z1 ->
|
||||
db.BroadcastZoneList.find { z2 -> z2.SoundChannel == z1 } != null
|
||||
db.broadcastDB.List.find { z2 -> z2.SoundChannel == z1 } != null
|
||||
}
|
||||
// check apakah tiap zone ada di SoundChannelList dan Online
|
||||
.filter { z3 ->
|
||||
@@ -75,7 +75,7 @@ class MainExtension01 {
|
||||
fun Get_MessageBank_by_id(id: Int, languages: List<String> = urutan_bahasa): ArrayList<Messagebank> {
|
||||
val mb_list = ArrayList<Messagebank>()
|
||||
languages.forEach { lang ->
|
||||
db.MessagebankList.find { mb -> mb.ANN_ID == id.toUInt() && mb.Language == lang && mb.Voice_Type == selected_voice }
|
||||
db.messageDB.List.find { mb -> mb.ANN_ID == id.toUInt() && mb.Language == lang && mb.Voice_Type == selected_voice }
|
||||
?.let {
|
||||
mb_list.add(it)
|
||||
}
|
||||
@@ -169,7 +169,7 @@ class MainExtension01 {
|
||||
return
|
||||
}
|
||||
// dapatkan soundbank array berdasarkan VoiceType dan Language
|
||||
val sb = db.SoundbankList
|
||||
val sb = db.soundDB.List
|
||||
.filter { it.VoiceType == mb.Voice_Type }
|
||||
.filter { it.Language == mb.Language }
|
||||
if (sb.isEmpty()) {
|
||||
@@ -479,7 +479,8 @@ class MainExtension01 {
|
||||
* Read and process Queue_Paging table.
|
||||
*/
|
||||
fun Read_Queue_Paging(){
|
||||
for (qp in db.Read_Queue_Paging()) {
|
||||
db.queuepagingDB.Get()
|
||||
for (qp in db.queuepagingDB.List) {
|
||||
if (qp.BroadcastZones.isNotBlank()) {
|
||||
val zz = qp.BroadcastZones.split(";")
|
||||
if (AllBroadcastZonesValid(zz)) {
|
||||
@@ -496,12 +497,12 @@ class MainExtension01 {
|
||||
"Broadcast started PAGING with Filename '${qp.Message}' to zones: ${qp.BroadcastZones}"
|
||||
Logger.info { logmessage }
|
||||
db.Add_Log("AAS", logmessage)
|
||||
db.Delete_Queue_Paging_by_index(qp.index)
|
||||
db.queuepagingDB.DeleteByIndex(qp.index.toInt())
|
||||
|
||||
return
|
||||
} else {
|
||||
// file tidak valid, delete from queue paging
|
||||
db.Delete_Queue_Paging_by_index(qp.index)
|
||||
db.queuepagingDB.DeleteByIndex(qp.index.toInt())
|
||||
db.Add_Log(
|
||||
"AAS",
|
||||
"Cancelled paging message with index ${qp.index} due to invalid audio file"
|
||||
@@ -552,7 +553,7 @@ class MainExtension01 {
|
||||
"Broadcast started SHALAT message with generated file '$targetfile' to zones: ${qp.BroadcastZones}"
|
||||
Logger.info { logmsg }
|
||||
db.Add_Log("AAS", logmsg)
|
||||
db.Delete_Queue_Paging_by_index(qp.index)
|
||||
db.queuepagingDB.DeleteByIndex(qp.index.toInt())
|
||||
} else {
|
||||
db.Add_Log(
|
||||
"AAS",
|
||||
@@ -565,13 +566,13 @@ class MainExtension01 {
|
||||
|
||||
},
|
||||
{ err ->
|
||||
db.Delete_Queue_Paging_by_index(qp.index)
|
||||
db.queuepagingDB.DeleteByIndex(qp.index.toInt())
|
||||
db.Add_Log("AAS", err)
|
||||
}
|
||||
)
|
||||
} else {
|
||||
// tidak ada messagebank dengan ann_id ini, delete from queue paging
|
||||
db.Delete_Queue_Paging_by_index(qp.index)
|
||||
db.queuepagingDB.DeleteByIndex(qp.index.toInt())
|
||||
db.Add_Log(
|
||||
"AAS",
|
||||
"Cancelled Shalat message with index ${qp.index} due to ANN_ID $ann_id not found in Messagebank"
|
||||
@@ -580,7 +581,7 @@ class MainExtension01 {
|
||||
}
|
||||
} else {
|
||||
// invalid ann_id, delete from queue paging
|
||||
db.Delete_Queue_Paging_by_index(qp.index)
|
||||
db.queuepagingDB.DeleteByIndex(qp.index.toInt())
|
||||
db.Add_Log(
|
||||
"AAS",
|
||||
"Cancelled Shalat message with index ${qp.index} due to invalid ANN_ID"
|
||||
@@ -590,7 +591,7 @@ class MainExtension01 {
|
||||
}
|
||||
} else {
|
||||
// ada broadcast zone yang tidak valid, delete from queue paging
|
||||
db.Delete_Queue_Paging_by_index(qp.index)
|
||||
db.queuepagingDB.DeleteByIndex(qp.index.toInt())
|
||||
db.Add_Log(
|
||||
"AAS",
|
||||
"Cancelled paging message with index ${qp.index} due to invalid broadcast zone"
|
||||
@@ -598,7 +599,7 @@ class MainExtension01 {
|
||||
}
|
||||
} else {
|
||||
// invalid broadcast zone, delete from queue paging
|
||||
db.Delete_Queue_Paging_by_index(qp.index)
|
||||
db.queuepagingDB.DeleteByIndex(qp.index.toInt())
|
||||
db.Add_Log("AAS", "Cancelled paging message with index ${qp.index} due to empty broadcast zone")
|
||||
}
|
||||
}
|
||||
@@ -609,7 +610,8 @@ class MainExtension01 {
|
||||
* Read and process Queue_Table table.
|
||||
*/
|
||||
fun Read_Queue_Table(){
|
||||
db.Read_Queue_Table().forEach { qa ->
|
||||
db.queuetableDB.Get()
|
||||
db.queuetableDB.List.forEach { qa ->
|
||||
if (qa.BroadcastZones.isNotEmpty()) {
|
||||
val zz = qa.BroadcastZones.split(";")
|
||||
if (AllBroadcastZonesValid(zz)) {
|
||||
@@ -645,7 +647,7 @@ class MainExtension01 {
|
||||
"AAS",
|
||||
"Cancelled SOUNDBANK message with index ${qa.index} due to missing or invalid ANN_ID in SB_TAGS"
|
||||
)
|
||||
db.Delete_Queue_Table_by_index(qa.index)
|
||||
db.queuetableDB.DeleteByIndex(qa.index.toInt())
|
||||
return@forEach
|
||||
}
|
||||
// sampe sini punya ann_id valid
|
||||
@@ -680,7 +682,7 @@ class MainExtension01 {
|
||||
"Broadcast started SOUNDBANK message with generated file '$targetfile' to zones: ${qa.BroadcastZones}"
|
||||
Logger.info { logmsg }
|
||||
db.Add_Log("AAS", logmsg)
|
||||
db.Delete_Queue_Table_by_index(qa.index)
|
||||
db.queuetableDB.DeleteByIndex(qa.index.toInt())
|
||||
|
||||
}
|
||||
}
|
||||
@@ -690,12 +692,12 @@ class MainExtension01 {
|
||||
{
|
||||
err ->
|
||||
db.Add_Log("AAS", err)
|
||||
db.Delete_Queue_Table_by_index(qa.index)
|
||||
db.queuetableDB.DeleteByIndex(qa.index.toInt())
|
||||
})
|
||||
}
|
||||
} else {
|
||||
// tidak ada messagebank dengan ann_id ini, delete from queue table
|
||||
db.Delete_Queue_Table_by_index(qa.index)
|
||||
db.queuetableDB.DeleteByIndex(qa.index.toInt())
|
||||
db.Add_Log(
|
||||
"AAS",
|
||||
"Cancelled SOUNDBANK message with index ${qa.index} due to ANN_ID $ann_id not found in Messagebank"
|
||||
@@ -735,7 +737,7 @@ class MainExtension01 {
|
||||
"Broadcast started TIMER message with generated file '$targetfile' to zones: ${qa.BroadcastZones}"
|
||||
Logger.info { logmsg }
|
||||
db.Add_Log("AAS", logmsg)
|
||||
db.Delete_Queue_Table_by_index(qa.index)
|
||||
db.queuetableDB.DeleteByIndex(qa.index.toInt())
|
||||
}
|
||||
}
|
||||
db.Add_Log("AAS", message)
|
||||
@@ -744,13 +746,13 @@ class MainExtension01 {
|
||||
{
|
||||
err ->
|
||||
db.Add_Log("AAS", err)
|
||||
db.Delete_Queue_Table_by_index(qa.index)
|
||||
db.queuetableDB.DeleteByIndex(qa.index.toInt())
|
||||
})
|
||||
}
|
||||
|
||||
} else {
|
||||
// tidak ada messagebank dengan ann_id ini, delete from queue table
|
||||
db.Delete_Queue_Table_by_index(qa.index)
|
||||
db.queuetableDB.DeleteByIndex(qa.index.toInt())
|
||||
db.Add_Log(
|
||||
"AAS",
|
||||
"Cancelled TIMER with index ${qa.index} due to ANN_ID $ann_id not found in Messagebank"
|
||||
@@ -758,7 +760,7 @@ class MainExtension01 {
|
||||
}
|
||||
} else {
|
||||
// invalid ann_id, delete from queue table
|
||||
db.Delete_Queue_Table_by_index(qa.index)
|
||||
db.queuetableDB.DeleteByIndex(qa.index.toInt())
|
||||
db.Add_Log(
|
||||
"AAS",
|
||||
"Cancelled TIMER with index ${qa.index} due to invalid ANN_ID"
|
||||
@@ -769,7 +771,7 @@ class MainExtension01 {
|
||||
}
|
||||
} else {
|
||||
// ada broadcast zone yang tidak valid, delete from queue table
|
||||
db.Delete_Queue_Table_by_index(qa.index)
|
||||
db.queuetableDB.DeleteByIndex(qa.index.toInt())
|
||||
db.Add_Log(
|
||||
"AAS",
|
||||
"Cancelled table message with index ${qa.index} due to invalid broadcast zone"
|
||||
@@ -777,7 +779,7 @@ class MainExtension01 {
|
||||
}
|
||||
} else {
|
||||
// invalid broadcast zone, delete from queue table
|
||||
db.Delete_Queue_Table_by_index(qa.index)
|
||||
db.queuetableDB.DeleteByIndex(qa.index.toInt())
|
||||
db.Add_Log("AAS", "Cancelled table message with index ${qa.index} due to empty broadcast zone")
|
||||
}
|
||||
}
|
||||
@@ -794,7 +796,7 @@ class MainExtension01 {
|
||||
// detik harus 00
|
||||
if (localtime.second != 0) return
|
||||
val timestring = timeformat2.format(localtime)
|
||||
val sch = db.SchedulebankList.filter {
|
||||
val sch = db.scheduleDB.List.filter {
|
||||
it.Time == timestring && it.Enable
|
||||
}
|
||||
// tidak ada schedule dengan time sekarang dan enable=true
|
||||
|
||||
Reference in New Issue
Block a user