diff src/choose_server.html.luan @ 13:af2b95854072

add server records
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 30 Oct 2023 21:32:42 -0600
parents 3e2cb946d511
children
line wrap: on
line diff
--- a/src/choose_server.html.luan	Mon Oct 30 14:59:45 2023 -0600
+++ b/src/choose_server.html.luan	Mon Oct 30 21:32:42 2023 -0600
@@ -15,6 +15,9 @@
 local header = Shared.header or error()
 local footer = Shared.footer or error()
 local Config = require "site:/lib/Config.luan"
+local Utils = require "site:/lib/Utils.luan"
+local list_to_set = Utils.list_to_set or error()
+local Server = require "site:/lib/Server.luan"
 local Logging = require "luan:logging/Logging.luan"
 local logger = Logging.logger "choose_server.html"
 
@@ -61,9 +64,15 @@
 	-- logger.info(result)
 	result = json_parse(result)
 	-- logger.info(stringify(result))
+
+	local set = list_to_set{}
+	for _, server in ipairs(Server.get_user_servers()) do
+		set[server.discord_id] = true
+	end
+
 	local servers = {}
 	for _, server in ipairs(result) do
-		if server.owner then
+		if server.owner and not set[server.id] then
 			servers[#servers+1] = server
 		end
 	end