Remove todo, rename registry key

This commit is contained in:
Brahim Hadriche committed 2022-11-19 14:08:00 -05:00
1 parent 1b4d0b5f90
commit 4f22353d14
7 files changed
+6 -23

No files matched your search

@@ -10,7 +10,6 @@
<field id="focus" type="boolean" alwaysNotify="true" /> <field id="focus" type="boolean" alwaysNotify="true" />
</interface> </interface>
<children> <children>
<!-- TODO: Fix layout where viewCount label disappears if title is two lines -->
<RowList <RowList
itemComponentName="VideoRowCell" itemComponentName="VideoRowCell"
id="rowList" id="rowList"
-2
View File
@@ -38,7 +38,6 @@ end function
function OnNavBarEscape() function OnNavBarEscape()
index = m.navBar.escapeIndex index = m.navBar.escapeIndex
'TODO: search at index 0
if index = 0 if index = 0
m.searchScreen.focus = true m.searchScreen.focus = true
else if index = 1 else if index = 1
@@ -53,7 +52,6 @@ function OnNavIndexChange() as void
if index = -1 if index = -1
return return
end if end if
'TODO: search at index 0
if index = 0 if index = 0
m.searchScreen.visible = true m.searchScreen.visible = true
m.homeGridScreen.visible = false m.homeGridScreen.visible = false
@@ -49,7 +49,6 @@ namespace Http
router.GenerateDirectoryListing(path, router, request, response) router.GenerateDirectoryListing(path, router, request, response)
return true return true
else if stat.type = "file" else if stat.type = "file"
' TODO: implement
response.mimetype = WebUtils.MimeType(decoded_uri) response.mimetype = WebUtils.MimeType(decoded_uri)
response.fileLength = stat.size response.fileLength = stat.size
router.log.info("uri=" + uri + ", target=" + path + ", content-type=" + response.mimetype + ", content-length=" + Stri(response.fileLength).trim()) router.log.info("uri=" + uri + ", target=" + path + ", content-type=" + response.mimetype + ", content-length=" + Stri(response.fileLength).trim())
@@ -17,7 +17,7 @@ namespace Http
' Token is encoded twice for some reason ' Token is encoded twice for some reason
token = WebUtils.UrlUnescape(components["token"]).DecodeUriComponent() token = WebUtils.UrlUnescape(components["token"]).DecodeUriComponent()
print(`Got Token: ${token}`) print(`Got Token: ${token}`)
RegistryUtils.Write("token", token) RegistryUtils.Write("invidious_token", token)
server.task.top.login = true server.task.top.login = true
end if end if
response.Redirect("/index.html?tab=settings") response.Redirect("/index.html?tab=settings")
+3 -4
View File
@@ -104,7 +104,6 @@ namespace Invidious
end function end function
function Search(q as string, args = invalid as dynamic) as object function Search(q as string, args = invalid as dynamic) as object
'page = invalid as integer, sort_by = invalid as RokuYoutube.Models.Invidious.SearchFilter.SortBy, date = invalid as RokuYoutube.Models.Invidious.SearchFilter.Date, duration = invalid as RokuYoutube.Models.Invidious.SearchFilter.Duration, _type = invalid as RokuYoutube.Models.Invidious.SearchFilter.SearchType, features = invalid as RokuYoutube.Models.Invidious.SearchFilter.Features) as object
url = `${Invidious.API_URL}${Invidious.SEARCH_ENDPOINT}` url = `${Invidious.API_URL}${Invidious.SEARCH_ENDPOINT}`
_args = Invidious.DefaultArgs() _args = Invidious.DefaultArgs()
@@ -155,7 +154,7 @@ namespace Invidious
end function end function
function GetAuthenticationHeaders() as object function GetAuthenticationHeaders() as object
token = RegistryUtils.Read("token") token = RegistryUtils.Read("invidious_token")
if token = invalid if token = invalid
return invalid return invalid
end if end if
@@ -180,7 +179,7 @@ namespace Invidious
response = Requests().get(url, args) response = Requests().get(url, args)
if response.statuscode = 403 if response.statuscode = 403
RegistryUtils.Delete("token") RegistryUtils.Delete("invidious_token")
end if end if
if response.statuscode = 200 if response.statuscode = 200
return response.json.videos return response.json.videos
@@ -204,7 +203,7 @@ namespace Invidious
response = Requests().get(url, args) response = Requests().get(url, args)
if response.statuscode = 403 if response.statuscode = 403
RegistryUtils.Delete("token") RegistryUtils.Delete("invidious_token")
end if end if
if response.statuscode = 200 if response.statuscode = 200
return response.json return response.json
+2 -2
View File
@@ -74,7 +74,7 @@ class InvidiousService
end function end function
function GetAuthenticationHeaders() as object function GetAuthenticationHeaders() as object
token = RegistryUtils.Read("token") token = RegistryUtils.Read("invidious_token")
if token = invalid if token = invalid
return invalid return invalid
end if end if
@@ -118,7 +118,7 @@ class InvidiousService
if response.statuscode = 403 if response.statuscode = 403
print(`Server responded with 403: ${response.text}`) print(`Server responded with 403: ${response.text}`)
print("deleting token...") print("deleting token...")
RegistryUtils.Delete("token") RegistryUtils.Delete("invidious_token")
end if end if
end function end function
-12
View File
@@ -1,14 +1,3 @@
'******************************************************
'Determine if the UI is displayed in SD or HD mode
'******************************************************
function IsHD() as boolean
di = CreateObject("roDeviceInfo")
if di.GetDisplayMode() = "720p"
return true
end if
return false
end function
function GetLocalIpAddress() as string function GetLocalIpAddress() as string
if m.ipAddress = invalid or m.ipAddress = "" if m.ipAddress = invalid or m.ipAddress = ""
di = CreateObject("roDeviceInfo") di = CreateObject("roDeviceInfo")
@@ -59,5 +48,4 @@ function GetDeviceInfo() as object
} }
end if end if
return m.deviceInfo return m.deviceInfo
end function end function