Skip to content

Commit 33169f5

Browse files
committed
Fixes crash when changeing scene collection
1 parent b8f513a commit 33169f5

File tree

1 file changed

+3
-22
lines changed

1 file changed

+3
-22
lines changed

obs-vrchat-log-reader.lua

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ local function reading()
6161
local strend = string.find(entry, ":", nil, true)
6262
local id = string.sub(entry, 2, strend - 1)
6363
print("World id: " .. id)
64-
local handle = io.popen("curl " .. obs.obs_data_get_string(script_settings, "curl_params") .. " -X GET \"https://api.vrchat.cloud/api/1/worlds/wrld_" .. id .. "\" -b \"apiKey=JlE5Jldo5Jibnk5O5hTx6XVqsJu4WJ26\" -A \"Obs-Vrchat-Log-Reader/1.0.1 (Discord: Nosjo, Email: admin@nosjo.xyz)\"")
64+
local handle = io.popen("curl " .. obs.obs_data_get_string(script_settings, "curl_params") .. " -X GET \"https://api.vrchat.cloud/api/1/worlds/wrld_" .. id .. "\" -b \"apiKey=JlE5Jldo5Jibnk5O5hTx6XVqsJu4WJ26\" -A \"Obs-Vrchat-Log-Reader/1.0.2 (Discord: Nosjo, Email: admin@nosjo.xyz)\"")
6565
local txt = handle:read("*a")
6666
print("Raw json: " .. txt)
6767
local arr = json.decode(txt)
@@ -129,25 +129,6 @@ function script_properties()
129129
return props
130130
end
131131

132-
--init
133-
local function is_frontend_ready()
134-
local scene = obs.obs_frontend_get_current_scene()
135-
local ready = scene ~= nil
136-
obs.obs_source_release(scene)
137-
return ready
138-
end
139-
140-
local function try_first_load()
141-
if is_frontend_ready() then
142-
obs.timer_remove(try_first_load)
143-
init()
144-
end
145-
end
146-
147-
function _G.script_load(settings)
148-
if not is_frontend_ready() then
149-
obs.timer_add(try_first_load, 1000)
150-
else
151-
init()
152-
end
132+
function script_load(settings)
133+
init()
153134
end

0 commit comments

Comments
 (0)