some fix WSSongListRoutes.kt

- delete websocket key
- else updated.
This commit is contained in:
dalbodeule
2024-08-05 14:38:16 +09:00
parent cc23ac03e7
commit 75da1c1576
5 changed files with 34 additions and 10 deletions

View File

@@ -9,7 +9,6 @@ import org.jetbrains.exposed.sql.ReferenceOption
object SongConfigs: IntIdTable("song_config") {
val user = reference("user", Users, onDelete = ReferenceOption.CASCADE)
val token = varchar("token", 64).nullable()
val password = varchar("password", 8).nullable()
val streamerOnly = bool("streamer_only").default(false)
val queueLimit = integer("queue_limit").default(50)
val personalLimit = integer("personal_limit").default(5)
@@ -19,7 +18,6 @@ class SongConfig(id: EntityID<Int>) : IntEntity(id) {
var user by User referencedOn SongConfigs.user
var token by SongConfigs.token
var password by SongConfigs.password
var streamerOnly by SongConfigs.streamerOnly
var queueLimit by SongConfigs.queueLimit
var personalLimit by SongConfigs.personalLimit

View File

@@ -60,14 +60,13 @@ object SongConfigService {
}
}
fun updateSession(user: User, token: String?, password: String?): SongConfig {
fun updateSession(user: User, token: String?): SongConfig {
return transaction {
var songConfig = SongConfig.find(SongConfigs.user eq user.id).firstOrNull()
if (songConfig == null) {
songConfig = initConfig(user)
}
songConfig.token = token
songConfig.password = password
songConfig
}