Linter: Code style: remove parenthesis around conditions
This commit is contained in:
parent
da54bc86fe
commit
579475a34c
|
@ -105,12 +105,12 @@ function onKeyEvent(key as string, press as boolean) as boolean
|
||||||
if not press then return false
|
if not press then return false
|
||||||
|
|
||||||
if key = "left"
|
if key = "left"
|
||||||
if(m.selectedFocusedIndex > 0) m.selectedFocusedIndex = m.selectedFocusedIndex - 1
|
if m.selectedFocusedIndex > 0 then m.selectedFocusedIndex = m.selectedFocusedIndex - 1
|
||||||
highlightSelected(m.selectedFocusedIndex)
|
highlightSelected(m.selectedFocusedIndex)
|
||||||
m.top.focusedIndex = m.selectedFocusedIndex
|
m.top.focusedIndex = m.selectedFocusedIndex
|
||||||
return true
|
return true
|
||||||
else if key = "right"
|
else if key = "right"
|
||||||
if(m.selectedFocusedIndex < m.buttonCount - 1) m.selectedFocusedIndex = m.selectedFocusedIndex + 1
|
if m.selectedFocusedIndex < m.buttonCount - 1 then m.selectedFocusedIndex = m.selectedFocusedIndex + 1
|
||||||
highlightSelected(m.selectedFocusedIndex)
|
highlightSelected(m.selectedFocusedIndex)
|
||||||
m.top.focusedIndex = m.selectedFocusedIndex
|
m.top.focusedIndex = m.selectedFocusedIndex
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -287,7 +287,7 @@ end sub
|
||||||
'Check if options updated and any reloading required
|
'Check if options updated and any reloading required
|
||||||
sub optionsClosed()
|
sub optionsClosed()
|
||||||
|
|
||||||
if (m.options.view = "tvGuide") then
|
if m.options.view = "tvGuide" then
|
||||||
showTVGuid()
|
showTVGuid()
|
||||||
return
|
return
|
||||||
else if m.tvGuide <> invalid then
|
else if m.tvGuide <> invalid then
|
||||||
|
|
|
@ -135,15 +135,15 @@ function onKeyEvent(key as string, press as boolean) as boolean
|
||||||
|
|
||||||
return true
|
return true
|
||||||
else if key = "OK"
|
else if key = "OK"
|
||||||
if(m.menus[m.selectedItem].isInFocusChain()) then
|
if m.menus[m.selectedItem].isInFocusChain() then
|
||||||
' Handle View Screen
|
' Handle View Screen
|
||||||
if(m.selectedItem = 0) then
|
if m.selectedItem = 0 then
|
||||||
m.selectedViewIndex = m.menus[0].itemSelected
|
m.selectedViewIndex = m.menus[0].itemSelected
|
||||||
m.top.view = m.viewNames[m.selectedViewIndex]
|
m.top.view = m.viewNames[m.selectedViewIndex]
|
||||||
end if
|
end if
|
||||||
|
|
||||||
' Handle Sort screen
|
' Handle Sort screen
|
||||||
if(m.selectedItem = 1) then
|
if m.selectedItem = 1 then
|
||||||
if m.menus[1].itemSelected <> m.selectedSortIndex then
|
if m.menus[1].itemSelected <> m.selectedSortIndex then
|
||||||
m.menus[1].focusedCheckedIconUri = m.global.constants.icons.ascending_black
|
m.menus[1].focusedCheckedIconUri = m.global.constants.icons.ascending_black
|
||||||
m.menus[1].checkedIconUri = m.global.constants.icons.ascending_white
|
m.menus[1].checkedIconUri = m.global.constants.icons.ascending_white
|
||||||
|
@ -165,7 +165,7 @@ function onKeyEvent(key as string, press as boolean) as boolean
|
||||||
end if
|
end if
|
||||||
end if
|
end if
|
||||||
' Handle Filter screen
|
' Handle Filter screen
|
||||||
if(m.selectedItem = 2) then
|
if m.selectedItem = 2 then
|
||||||
m.selectedFilterIndex = m.menus[2].itemSelected
|
m.selectedFilterIndex = m.menus[2].itemSelected
|
||||||
m.top.filter = m.filterNames[m.selectedFilterIndex]
|
m.top.filter = m.filterNames[m.selectedFilterIndex]
|
||||||
end if
|
end if
|
||||||
|
|
|
@ -65,7 +65,7 @@ sub onLibrariesLoaded()
|
||||||
[464, 331] ' Next Up
|
[464, 331] ' Next Up
|
||||||
]
|
]
|
||||||
' validate library data
|
' validate library data
|
||||||
if (m.libraryData <> invalid and m.libraryData.count() > 0) then
|
if m.libraryData <> invalid and m.libraryData.count() > 0 then
|
||||||
userConfig = m.top.userConfig
|
userConfig = m.top.userConfig
|
||||||
' populate My Media row
|
' populate My Media row
|
||||||
filteredMedia = filterNodeArray(m.libraryData, "id", userConfig.MyMediaExcludes)
|
filteredMedia = filterNodeArray(m.libraryData, "id", userConfig.MyMediaExcludes)
|
||||||
|
|
|
@ -198,7 +198,7 @@ function onKeyEvent(key as string, press as boolean) as boolean
|
||||||
|
|
||||||
' Due to the way the button pressed event works, need to catch the release for the button as the press is being sent
|
' Due to the way the button pressed event works, need to catch the release for the button as the press is being sent
|
||||||
' directly to the main loop. Will get this sorted in the layout update for Movie Details
|
' directly to the main loop. Will get this sorted in the layout update for Movie Details
|
||||||
if (key = "OK" and m.top.findNode("audio-button").isInFocusChain())
|
if key = "OK" and m.top.findNode("audio-button").isInFocusChain()
|
||||||
m.options.visible = true
|
m.options.visible = true
|
||||||
m.options.setFocus(true)
|
m.options.setFocus(true)
|
||||||
end if
|
end if
|
||||||
|
|
|
@ -79,7 +79,7 @@ function onKeyEvent(key as string, press as boolean) as boolean
|
||||||
|
|
||||||
return true
|
return true
|
||||||
else if key = "OK"
|
else if key = "OK"
|
||||||
if(m.menus[m.selectedItem].isInFocusChain()) then
|
if m.menus[m.selectedItem].isInFocusChain() then
|
||||||
|
|
||||||
selMenu = m.menus[m.selectedItem]
|
selMenu = m.menus[m.selectedItem]
|
||||||
selIndex = selMenu.itemSelected
|
selIndex = selMenu.itemSelected
|
||||||
|
|
|
@ -79,7 +79,7 @@ sub Main (args as Dynamic) as Void
|
||||||
' This now only references m. fields so could be placed anywhere, in theory
|
' This now only references m. fields so could be placed anywhere, in theory
|
||||||
' "group" is always "whats on the screen"
|
' "group" is always "whats on the screen"
|
||||||
' m.scene's children is the "previous view" stack
|
' m.scene's children is the "previous view" stack
|
||||||
while(true)
|
while true
|
||||||
msg = wait(0, m.port)
|
msg = wait(0, m.port)
|
||||||
if type(msg) = "roSGScreenEvent" and msg.isScreenClosed() then
|
if type(msg) = "roSGScreenEvent" and msg.isScreenClosed() then
|
||||||
print "CLOSING SCREEN"
|
print "CLOSING SCREEN"
|
||||||
|
@ -551,9 +551,9 @@ sub RunScreenSaver()
|
||||||
screen.createScene("Screensaver")
|
screen.createScene("Screensaver")
|
||||||
screen.Show()
|
screen.Show()
|
||||||
|
|
||||||
while(true)
|
while true
|
||||||
msg = wait(8000, m.port)
|
msg = wait(8000, m.port)
|
||||||
if (msg <> invalid)
|
if msg <> invalid
|
||||||
msgType = type(msg)
|
msgType = type(msg)
|
||||||
if msgType = "roSGScreenEvent"
|
if msgType = "roSGScreenEvent"
|
||||||
if msg.isScreenClosed() then return
|
if msg.isScreenClosed() then return
|
||||||
|
@ -565,7 +565,7 @@ end sub
|
||||||
|
|
||||||
sub wipe_groups()
|
sub wipe_groups()
|
||||||
' The 1 remaining child should be the overhang
|
' The 1 remaining child should be the overhang
|
||||||
while(m.scene.getChildCount() > 1)
|
while m.scene.getChildCount() > 1
|
||||||
m.scene.removeChildIndex(1)
|
m.scene.removeChildIndex(1)
|
||||||
end while
|
end while
|
||||||
end sub
|
end sub
|
||||||
|
|
|
@ -23,7 +23,7 @@ function CreateServerGroup()
|
||||||
server_hostname = config.content.getChild(0)
|
server_hostname = config.content.getChild(0)
|
||||||
group.observeField("backPressed", port)
|
group.observeField("backPressed", port)
|
||||||
|
|
||||||
while(true)
|
while true
|
||||||
msg = wait(0, port)
|
msg = wait(0, port)
|
||||||
if type(msg) = "roSGScreenEvent" and msg.isScreenClosed()
|
if type(msg) = "roSGScreenEvent" and msg.isScreenClosed()
|
||||||
return "false"
|
return "false"
|
||||||
|
@ -105,7 +105,7 @@ function CreateUserSelectGroup(users = [])
|
||||||
group.findNode("userRow").observeField("userSelected", port)
|
group.findNode("userRow").observeField("userSelected", port)
|
||||||
group.findNode("alternateOptions").observeField("itemSelected", port)
|
group.findNode("alternateOptions").observeField("itemSelected", port)
|
||||||
group.observeField("backPressed", port)
|
group.observeField("backPressed", port)
|
||||||
while(true)
|
while true
|
||||||
msg = wait(0, port)
|
msg = wait(0, port)
|
||||||
if type(msg) = "roSGScreenEvent" and msg.isScreenClosed()
|
if type(msg) = "roSGScreenEvent" and msg.isScreenClosed()
|
||||||
group.visible = false
|
group.visible = false
|
||||||
|
@ -163,7 +163,7 @@ function CreateSigninGroup(user = "")
|
||||||
|
|
||||||
group.observeField("backPressed", port)
|
group.observeField("backPressed", port)
|
||||||
|
|
||||||
while(true)
|
while true
|
||||||
msg = wait(0, port)
|
msg = wait(0, port)
|
||||||
if type(msg) = "roSGScreenEvent" and msg.isScreenClosed()
|
if type(msg) = "roSGScreenEvent" and msg.isScreenClosed()
|
||||||
group.visible = false
|
group.visible = false
|
||||||
|
|
|
@ -53,7 +53,7 @@ sub changeSubtitleDuringPlayback(newid)
|
||||||
video.control = "play"
|
video.control = "play"
|
||||||
video.globalCaptionMode = "Off" ' Using encoded subtitles - so turn off text subtitles
|
video.globalCaptionMode = "Off" ' Using encoded subtitles - so turn off text subtitles
|
||||||
|
|
||||||
else if (currentSubtitles <> invalid AND currentSubtitles.IsEncoded) then
|
else if currentSubtitles <> invalid AND currentSubtitles.IsEncoded then
|
||||||
|
|
||||||
' Switching from an Encoded stream to a text stream
|
' Switching from an Encoded stream to a text stream
|
||||||
video.control = "stop"
|
video.control = "stop"
|
||||||
|
@ -96,7 +96,7 @@ function sortSubtitles(id as string, MediaStreams)
|
||||||
if stream.type = "Subtitle" then
|
if stream.type = "Subtitle" then
|
||||||
|
|
||||||
url = ""
|
url = ""
|
||||||
if(stream.DeliveryUrl <> invalid) then
|
if stream.DeliveryUrl <> invalid then
|
||||||
url = buildURL(stream.DeliveryUrl)
|
url = buildURL(stream.DeliveryUrl)
|
||||||
end if
|
end if
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user