[+] Log recommendations

This commit is contained in:
Azalea Gui
2025-01-12 04:38:43 -05:00
parent 767d396171
commit f6a5a03346
2 changed files with 7 additions and 4 deletions

View File

@@ -209,13 +209,15 @@ abstract class GameApiController<T : IUserData>(val name: String, userDataClass:
SELECT user_id, music_id, count(*) as count
FROM ${tableName}_user_playlog_view
GROUP BY user_id, music_id;
""".trimIndent()).exec.numCsv("user_id", "music_id", "count")
""".trimIndent()).exec.also {
logger.info("Recommender fetched ${it.size} plays")
}.numCsv("user_id", "music_id", "count")
}
@API("recommender-update")
fun recommenderUpdate(@RP botSecret: String, @RB data: Map<Long, List<Int>>) {
if (botSecret != botProps.secret) 403 - "Invalid Secret"
recommendedMusic = data
logger.info("Recommender updated with ${data.size} users")
}
}