Linter Warnings

Variable Capitalization, Unused Variables, Unreachable Code
This commit is contained in:
Neil Burrows 2021-06-26 11:04:32 +01:00
parent fa75a11d27
commit 38fa383b4d
17 changed files with 9 additions and 39 deletions

View File

@ -174,7 +174,6 @@ end sub
sub ItemDataLoaded(msg)
itemData = msg.GetData()
data = msg.getField()
m.loadItemsTask.unobserveField("content")
m.loadItemsTask.content = []

View File

@ -31,10 +31,7 @@ function loadLibraries()
end function
sub updateSize()
sideborder = 100
m.top.translation = [111, 180]
itemWidth = 480
itemHeight = 330
'Set width of Rows to cut off at edge of Safe Zone
@ -213,7 +210,6 @@ end function
function updateLatestItems(msg)
itemData = msg.GetData()
data = msg.getField()
node = msg.getRoSGNode()
node.unobserveField("content")
node.content = []

View File

@ -24,8 +24,8 @@ sub loadProgramDetails()
program = createObject("roSGNode", "ScheduleProgramData")
program.json = data
program.channelIndex = ChannelIndex
program.programIndex = ProgramIndex
program.channelIndex = channelIndex
program.programIndex = programIndex
program.fullyLoaded = true
m.top.programDetails = program

View File

@ -8,12 +8,6 @@ sub init()
end sub
sub updateSize()
dimensions = m.top.getScene().currentDesignResolution
border = 200
'm.top.translation = [border, border + 115]
textHeight = 80
itemWidth = 300
itemHeight = 364

View File

@ -83,7 +83,6 @@ function onKeyEvent(key as string, press as boolean) as boolean
selMenu = m.menus[m.selectedItem]
selIndex = selMenu.itemSelected
child = selMenu.content.GetChild(selIndex)
if m.selectedAudioIndex = selIndex then
else

View File

@ -41,7 +41,6 @@ function getData()
end if
itemData = m.top.itemData
rowSize = m.top.rowSize
' todo - Or get the old data? I can't remember...
data = CreateObject("roSGNode", "ContentNode")

View File

@ -17,7 +17,6 @@ sub updateSize()
border = 96
m.top.translation = [border, 75 + 115]
textHeight = 80
itemWidth = (dimensions["width"] - border*2)
itemHeight = 300

View File

@ -14,7 +14,6 @@ sub init()
end sub
sub updateSize()
textHeight = 80
itemWidth = 200
itemHeight = 380 ' width * 1.5 + text
@ -38,7 +37,6 @@ function getData()
end if
seasonData = m.top.TVSeasonData
rowsize = m.top.rowSize
data = CreateObject("roSGNode", "ContentNode")
row = data.CreateChild("ContentNode")
row.title = "Seasons"

View File

@ -34,17 +34,14 @@ sub itemContentChanged()
if itemData.genres.count() > 0
setFieldText("genres", itemData.genres.join(", "))
end if
director = invalid
for each person in itemData.people
if person.type = "Director"
director = person.name
exit for
end if
end for
if itemData.taglines.count() > 0
setFieldText("tagline", itemData.taglines[0])
end if
' m.top.findNode("TVSeasonSelect").TVSeasonData = m.top.itemContent.seasons
end sub
sub setFieldText(field, value)

View File

@ -35,17 +35,14 @@ sub itemContentChanged()
if itemData.genres.count() > 0
setFieldText("genres", itemData.genres.join(", "))
end if
director = invalid
for each person in itemData.people
if person.type = "Director"
director = person.name
exit for
end if
end for
if itemData.taglines.count() > 0
setFieldText("tagline", itemData.taglines[0])
end if
' m.top.findNode("TVSeasonSelect").TVSeasonData = m.top.itemContent.seasons
end sub
sub setFieldText(field, value)

View File

@ -209,7 +209,6 @@ function Main (args as Dynamic) as Void
else
' TODO - switch on more node types
message_dialog("This type is not yet supported: " + selectedItem.type + ".")
selectedItem = invalid
end if
else if isNodeEvent(msg, "movieSelected")
' If you select a movie from ANYWHERE, follow this flow
@ -549,7 +548,7 @@ sub RunScreenSaver()
m.port = createObject("roMessagePort")
screen.setMessagePort(m.port)
scene = screen.createScene("Screensaver")
screen.createScene("Screensaver")
screen.Show()
while(true)

View File

@ -1,7 +1,7 @@
function ItemGetPlaybackInfo(id as string, StartTimeTicks = 0 as longinteger)
function ItemGetPlaybackInfo(id as string, startTimeTicks = 0 as longinteger)
params = {
"UserId": get_setting("active_user"),
"StartTimeTicks": StartTimeTicks,
"StartTimeTicks": startTimeTicks,
"IsPlayback": true,
"AutoOpenLiveStream": true,
"MaxStreamingBitrate": "140000000"
@ -16,7 +16,7 @@ function ItemPostPlaybackInfo(id as string, mediaSourceId = "" as string , audio
}
params = {
"UserId": get_setting("active_user"),
"StartTimeTicks": StartTimeTicks,
"StartTimeTicks": startTimeTicks,
"IsPlayback": true,
"AutoOpenLiveStream": true,
"MaxStreamingBitrate": "140000000",
@ -117,7 +117,6 @@ function ItemMetaData(id as string)
' Return json if we don't know what it is
return data
end if
return data
end function
' Seasons for a TV Show

View File

@ -42,7 +42,6 @@ end function
function deleteTranscode(id)
devinfo = CreateObject("roDeviceInfo")
device_id = devinfo.getChannelClientID()
req = APIRequest("/Videos/ActiveEncodings", { "deviceID" : devinfo.getChannelClientID(), "PlaySessionId": id })
req.setRequest("DELETE")
postVoid(req)

View File

@ -21,8 +21,7 @@ function MarkItemWatched(id as String)
dateStr += leftPad(stri(date.getSeconds()).trim(), "0", 2)
url = Substitute("Users/{0}/PlayedItems/{1}", get_setting("active_user"), id)
resp = APIRequest(url, {"DatePlayed": dateStr})
data = postJson(resp)
APIRequest(url, {"DatePlayed": dateStr})
end function
function UnmarkItemWatched(id as String)

View File

@ -2,10 +2,8 @@ function get_token(user as String, password as String)
url = "Users/AuthenticateByName?format=json"
req = APIRequest(url)
encPass = CreateObject("roUrlTransfer")
json = postJson(req, FormatJson({ "Username": user, "Pw": password }))
if json = invalid then return invalid
userdata = CreateObject("roSGNode", "UserData")

View File

@ -40,7 +40,7 @@ sub changeSubtitleDuringPlayback(newid)
video = m.scene.focusedChild
' If no change of subtitle track, return
if newId = video.SelectedSubtitle then return
if newid = video.SelectedSubtitle then return
currentSubtitles = video.Subtitles[video.SelectedSubtitle]
newSubtitles = video.Subtitles[newid]
@ -69,7 +69,7 @@ sub changeSubtitleDuringPlayback(newid)
video.subtitleTrack = video.availableSubtitleTracks[newSubtitles.TextIndex].TrackName
end if
video.SelectedSubtitle = newId
video.SelectedSubtitle = newid
end sub
@ -91,7 +91,6 @@ end function
function sortSubtitles(id as string, MediaStreams)
tracks = { "forced": [], "default": [], "normal": [] }
'Too many args for using substitute
dashedid = id.left(8) + "-" + id.mid(8,4) + "-" + id.mid(12,4) + "-" + id.mid(16,4) + "-" + id.right(12)
prefered_lang = m.user.Configuration.SubtitleLanguagePreference
for each stream in MediaStreams
if stream.type = "Subtitle" then

View File

@ -101,7 +101,6 @@ function lastFocusedChild(obj as object) as object
end function
function show_dialog(message as string, options = [], defaultSelection = 0) as integer
group = m.scene.focusedChild
lastFocus = lastFocusedChild(m.scene)
'We want to handle backPressed instead of the main loop
m.scene.unobserveField("backPressed")