commit 20/10/2025
TODO Schedule belum beres
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package database
|
||||
|
||||
import codes.Somecodes.Companion.ValiDateForLogHtml
|
||||
import codes.Somecodes.Companion.ValidScheduleDay
|
||||
import codes.Somecodes.Companion.toJsonString
|
||||
import content.Category
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@@ -155,6 +156,7 @@ class MariaDB(
|
||||
statement?.setString(6, data.Path)
|
||||
val rowsAffected = statement?.executeUpdate()
|
||||
if (rowsAffected != null && rowsAffected > 0) {
|
||||
Add_Log("AAS", "Soundbank added: ${data.Description}; TAG: ${data.TAG}; Category: ${data.Category}; Language: ${data.Language}; VoiceType: ${data.VoiceType}; Path: ${data.Path}")
|
||||
Logger.info("Soundbank added: ${data.Description}" as Any)
|
||||
return true
|
||||
} else {
|
||||
@@ -207,6 +209,7 @@ class MariaDB(
|
||||
val rowsAffected = statement?.executeUpdate()
|
||||
if (rowsAffected != null && rowsAffected > 0) {
|
||||
Logger.info("Soundbank updated at index $index: ${data.Description}" as Any)
|
||||
Add_Log("AAS", "Soundbank updated at index $index: ${data.Description}; TAG: ${data.TAG}; Category: ${data.Category}; Language: ${data.Language}; VoiceType: ${data.VoiceType}; Path: ${data.Path}")
|
||||
return true
|
||||
} else {
|
||||
Logger.warn("No soundbank entry updated at index $index for: ${data.Description}" as Any)
|
||||
@@ -359,6 +362,7 @@ class MariaDB(
|
||||
val rowsAffected = statement?.executeUpdate()
|
||||
if (rowsAffected != null && rowsAffected > 0) {
|
||||
Logger.info("Messagebank added: ${data.Description}" as Any)
|
||||
Add_Log("AAS", "Messagebank added: ${data.Description}; Language: ${data.Language}; ANN_ID: ${data.ANN_ID}; Voice_Type: ${data.Voice_Type}")
|
||||
return true
|
||||
} else {
|
||||
Logger.warn("No messagebank entry added for: ${data.Description}" as Any)
|
||||
@@ -565,6 +569,7 @@ class MariaDB(
|
||||
val rowsAffected = statement.executeUpdate()
|
||||
if (rowsAffected > 0) {
|
||||
Logger.info("Language link added: ${data.TAG} -> ${data.Language}" as Any)
|
||||
Add_Log("AAS", "Language link added: ${data.TAG} -> ${data.Language}")
|
||||
return true
|
||||
} else {
|
||||
Logger.warn("No language link entry added for: ${data.TAG} -> ${data.Language}" as Any)
|
||||
@@ -606,6 +611,7 @@ class MariaDB(
|
||||
val rowsAffected = statement?.executeUpdate()
|
||||
if (rowsAffected != null && rowsAffected > 0) {
|
||||
Logger.info("Language link updated at index $index: ${data.TAG} -> ${data.Language}" as Any)
|
||||
Add_Log("AAS", "Language link updated at index $index: ${data.TAG} -> ${data.Language}")
|
||||
return true
|
||||
} else {
|
||||
Logger.warn("No language link entry updated at index $index for: ${data.TAG} -> ${data.Language}" as Any)
|
||||
@@ -670,7 +676,7 @@ class MariaDB(
|
||||
val statement = connection.createStatement()
|
||||
val resultSet = statement?.executeQuery("SELECT * FROM ${super.dbName}")
|
||||
val workbook = XSSFWorkbook()
|
||||
val sheet = workbook.createSheet("languagelinking")
|
||||
val sheet = workbook.createSheet("LanguageLink")
|
||||
val headerRow = sheet.createRow(0)
|
||||
val headers = arrayOf("Index", "TAG", "Language")
|
||||
for ((colIndex, header) in headers.withIndex()) {
|
||||
@@ -737,7 +743,7 @@ class MariaDB(
|
||||
}
|
||||
|
||||
override fun Add(data: ScheduleBank): Boolean {
|
||||
if (!ValidDate(data.Day)) {
|
||||
if (!ValidScheduleDay(data.Day)) {
|
||||
Logger.error("Error adding schedulebank entry: Invalid date format ${data.Day}" as Any)
|
||||
return false
|
||||
}
|
||||
@@ -759,6 +765,7 @@ class MariaDB(
|
||||
val rowsAffected = statement?.executeUpdate()
|
||||
if (rowsAffected != null && rowsAffected > 0) {
|
||||
Logger.info("Schedulebank added: ${data.Description}" as Any)
|
||||
Add_Log("AAS", "Schedulebank added: ${data.Description}; Day: ${data.Day}; Time: ${data.Time}; Soundpath: ${data.Soundpath}; Repeat: ${data.Repeat}; Enable: ${data.Enable}; BroadcastZones: ${data.BroadcastZones}; Language: ${data.Language}")
|
||||
return true
|
||||
} else {
|
||||
Logger.warn("No schedulebank entry added for: ${data.Description}" as Any)
|
||||
@@ -826,6 +833,7 @@ class MariaDB(
|
||||
val rowsAffected = statement?.executeUpdate()
|
||||
if (rowsAffected != null && rowsAffected > 0) {
|
||||
Logger.info("Schedulebank updated at index $index: ${data.Description}" as Any)
|
||||
Add_Log("AAS", "Schedulebank updated at index $index: ${data.Description}; Day: ${data.Day}; Time: ${data.Time}; Soundpath: ${data.Soundpath}; Repeat: ${data.Repeat}; Enable: ${data.Enable}; BroadcastZones: ${data.BroadcastZones}; Language: ${data.Language}")
|
||||
return true
|
||||
} else {
|
||||
Logger.warn("No schedulebank entry updated at index $index for: ${data.Description}" as Any)
|
||||
@@ -1003,6 +1011,7 @@ class MariaDB(
|
||||
val rowsAffected = statement?.executeUpdate()
|
||||
if (rowsAffected != null && rowsAffected > 0) {
|
||||
Logger.info("Broadcast zone added: ${data.description}" as Any)
|
||||
Add_Log("AAS", "Broadcast zone added: ${data.description}; SoundChannel: ${data.SoundChannel}; id: ${data.id}; bp: ${data.bp}")
|
||||
return true
|
||||
} else {
|
||||
Logger.warn("No broadcast zone entry added for: ${data.description}" as Any)
|
||||
@@ -1049,6 +1058,7 @@ class MariaDB(
|
||||
val rowsAffected = statement?.executeUpdate()
|
||||
if (rowsAffected != null && rowsAffected > 0) {
|
||||
Logger.info("Broadcast zone updated at index $index: ${data.description}" as Any)
|
||||
Add_Log("AAS", "Broadcast zone updated at index $index: ${data.description}; SoundChannel: ${data.SoundChannel}; id: ${data.id}; bp: ${data.bp}")
|
||||
return true
|
||||
} else {
|
||||
Logger.warn("No broadcast zone entry updated at index $index for: ${data.description}" as Any)
|
||||
@@ -1516,6 +1526,7 @@ class MariaDB(
|
||||
val rowsAffected = statement?.executeUpdate()
|
||||
if (rowsAffected != null && rowsAffected > 0) {
|
||||
Logger.info("SoundChannel updated: ${data.channel} -> ${data.ip}" as Any)
|
||||
Add_Log("AAS", "SoundChannel updated: ${data.channel} -> ${data.ip}")
|
||||
return true
|
||||
} else {
|
||||
Logger.warn("No SoundChannel entry updated for: ${data.channel} -> ${data.ip}" as Any)
|
||||
@@ -1557,6 +1568,7 @@ class MariaDB(
|
||||
val rowsAffected = statement?.executeUpdate()
|
||||
if (rowsAffected != null && rowsAffected > 0) {
|
||||
Logger.info("SoundChannel updated at index $index: ${data.channel} -> ${data.ip}" as Any)
|
||||
Add_Log("AAS", "SoundChannel updated at index $index: ${data.channel} -> ${data.ip}")
|
||||
return true
|
||||
} else {
|
||||
Logger.warn("No SoundChannel entry updated at index $index for: ${data.channel} -> ${data.ip}" as Any)
|
||||
@@ -1687,6 +1699,7 @@ class MariaDB(
|
||||
val rowsAffected = statement?.executeUpdate()
|
||||
if (rowsAffected != null && rowsAffected > 0) {
|
||||
Logger.info("${super.dbName} IP cleared for index $index" as Any)
|
||||
Add_Log("AAS", "${super.dbName} IP cleared for index $index")
|
||||
return true
|
||||
} else {
|
||||
Logger.warn("No ${super.dbName} entry cleared for index $index" as Any)
|
||||
@@ -1901,6 +1914,7 @@ class MariaDB(
|
||||
val rowsAffected = statement?.executeUpdate()
|
||||
if (rowsAffected != null && rowsAffected > 0) {
|
||||
Logger.info("User added: ${data.username}" as Any)
|
||||
Add_Log("AAS", "User added: ${data.username}")
|
||||
return true
|
||||
} else {
|
||||
Logger.warn("No user entry added for: ${data.username}" as Any)
|
||||
@@ -1951,6 +1965,7 @@ class MariaDB(
|
||||
val rowsAffected = statement?.executeUpdate()
|
||||
if (rowsAffected != null && rowsAffected > 0) {
|
||||
Logger.info("User updated at index $index: ${data.username}" as Any)
|
||||
Add_Log("AAS", "User updated at index $index: ${data.username}")
|
||||
return true
|
||||
} else {
|
||||
Logger.warn("No user entry updated at index $index for: ${data.username}" as Any)
|
||||
|
||||
Reference in New Issue
Block a user