validation rule for callFunc operator
This commit is contained in:
1 parent
51966cb33f
commit
5982b5a75f
33 files changed
+64
-55
No files matched your search
@@ -12,7 +12,7 @@ namespace Http
|
||||
response = context.response
|
||||
invidiousNode = context.server.task.invidious
|
||||
|
||||
authLink = invidiousNode@.GetAuthorizeTokenLink(invalid)
|
||||
authLink = invidiousNode@.GetAuthorizeTokenLink()
|
||||
response.Redirect(authLink)
|
||||
return true
|
||||
end function)
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Http
|
||||
task = context.server.task
|
||||
playQueue = task.playQueue
|
||||
|
||||
queue = playQueue@.GetQueue(invalid)
|
||||
queue = playQueue@.GetQueue()
|
||||
response.Json(queue)
|
||||
return true
|
||||
end function)
|
||||
@@ -42,7 +42,7 @@ namespace Http
|
||||
contentNode = InvidiousContent.ToRowCellContentNode(payload, invalid)
|
||||
playQueue@.AddToQueue(contentNode)
|
||||
|
||||
queue = playQueue@.GetQueue(invalid)
|
||||
queue = playQueue@.GetQueue()
|
||||
response.Json(queue)
|
||||
return true
|
||||
end function)
|
||||
@@ -95,7 +95,7 @@ namespace Http
|
||||
return true
|
||||
end if
|
||||
|
||||
playQueue@.Clear(invalid)
|
||||
playQueue@.Clear()
|
||||
response.Default(204, "OK")
|
||||
return true
|
||||
end function)
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Http
|
||||
return true
|
||||
end if
|
||||
|
||||
userPrefs = preferences@.GetUserPreferences(invalid)
|
||||
userPrefs = preferences@.GetUserPreferences()
|
||||
response.Json(userPrefs)
|
||||
return true
|
||||
end function)
|
||||
@@ -55,7 +55,7 @@ namespace Http
|
||||
return true
|
||||
end if
|
||||
|
||||
preferences@.ClearUserPreferences(invalid)
|
||||
preferences@.ClearUserPreferences()
|
||||
response.Default(204, "OK")
|
||||
return true
|
||||
end function)
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Http
|
||||
state = {}
|
||||
|
||||
if ArrayUtils.IndexOfString(keys, "app") <> -1
|
||||
appInfo = applicationInfoNode@.GetAppInfo(invalid)
|
||||
appInfo = applicationInfoNode@.GetAppInfo()
|
||||
|
||||
if appInfo.lib_version_latest = "N/A"
|
||||
' If the lib_version_latest field is not available, we can give it a few seconds
|
||||
@@ -44,15 +44,15 @@ namespace Http
|
||||
end if
|
||||
|
||||
if ArrayUtils.IndexOfString(keys, "device") <> -1
|
||||
state["device"] = applicationInfoNode@.GetDeviceInfo(invalid)
|
||||
state["device"] = applicationInfoNode@.GetDeviceInfo()
|
||||
end if
|
||||
|
||||
if ArrayUtils.IndexOfString(keys, "invidious") <> -1
|
||||
authToken = invidiousNode.authToken
|
||||
state["invidious"] = {
|
||||
current_instance: invidiousNode@.GetCurrentInstance(invalid),
|
||||
current_instance: invidiousNode@.GetCurrentInstance(),
|
||||
' backup_instances: InvidiousSettings.GetBackupInstances(),
|
||||
auth_url: invidiousNode@.GetAuthorizeTokenLink(invalid),
|
||||
auth_url: invidiousNode@.GetAuthorizeTokenLink(),
|
||||
logged_in: authToken <> invalid,
|
||||
logged_in_instance: authToken <> invalid ? authToken.instance : invalid,
|
||||
logged_in_username: authToken <> invalid ? authToken.username : invalid
|
||||
@@ -60,7 +60,7 @@ namespace Http
|
||||
end if
|
||||
|
||||
if ArrayUtils.IndexOfString(keys, "preferences") <> -1
|
||||
state["preferences"] = preferencesNode@.GetUserPreferences(invalid)
|
||||
state["preferences"] = preferencesNode@.GetUserPreferences()
|
||||
end if
|
||||
|
||||
response.Json(state)
|
||||
|
||||
Reference in new issue
Block a user