mirror of
https://github.com/sr229/metastruct-experiments.git
synced 2024-09-20 06:30:36 +00:00
do not run getRemoteLanguageIndex() when no perm
Signed-off-by: Ayane Satomi <ayane@vignetteapp.org>
This commit is contained in:
parent
a500253033
commit
61768606dd
1 changed files with 2 additions and 3 deletions
|
@ -3,19 +3,18 @@
|
|||
--@client
|
||||
|
||||
local remoteLanguageIndex = "https://raw.githubusercontent.com/sr229/metastruct-experiments/master/starfall_metadata/allowed_google_voices.json"
|
||||
local localLanguageIndex = "./tts_index.json"
|
||||
local languageIndex = {}
|
||||
local errorLookup = { [2] = "Invalid language" }
|
||||
|
||||
local DEFAULT_LANGUAGE = "en-gb"
|
||||
local currentLang = DEFAULT_LANGUAGE
|
||||
|
||||
if not owner() then return end
|
||||
|
||||
-- Check if client has permission
|
||||
if not hasPermission("bass.loadURL", "https://translate.google.com/translate_tts") then return end
|
||||
|
||||
local function getRemoteLanguageIndex()
|
||||
if not hasPermission("http.get", remoteLanguageIndex) then return end
|
||||
|
||||
print("Building language index. Please be patient...")
|
||||
http.get(remoteLanguageIndex, function(body, len, hdrs, code)
|
||||
if len > 0 then
|
||||
|
|
Loading…
Reference in a new issue