Stop auto converting user settings to int. Update codebase to convert to int as needed
This commit is contained in:
parent
449cff412e
commit
464abddb2d
|
@ -22,7 +22,7 @@ sub init()
|
|||
m.nextEpisodeButton = m.top.findNode("nextEpisode")
|
||||
m.nextEpisodeButton.text = tr("Next Episode")
|
||||
m.nextEpisodeButton.setFocus(false)
|
||||
m.nextupbuttonseconds = m.global.session.user.settings["playback.nextupbuttonseconds"]
|
||||
m.nextupbuttonseconds = m.global.session.user.settings["playback.nextupbuttonseconds"].ToInt()
|
||||
|
||||
m.showNextEpisodeButtonAnimation = m.top.findNode("showNextEpisodeButton")
|
||||
m.hideNextEpisodeButtonAnimation = m.top.findNode("hideNextEpisodeButton")
|
||||
|
|
|
@ -73,7 +73,7 @@ sub loadItems()
|
|||
params["limit"] = 24
|
||||
params["EnableTotalRecordCount"] = false
|
||||
|
||||
maxDaysInNextUp = m.global.session.user.settings["ui.details.maxdaysnextup"]
|
||||
maxDaysInNextUp = m.global.session.user.settings["ui.details.maxdaysnextup"].ToInt()
|
||||
if isValid(maxDaysInNextUp)
|
||||
if maxDaysInNextUp > 0
|
||||
dateToday = CreateObject("roDateTime")
|
||||
|
|
|
@ -421,18 +421,20 @@ function getDeviceProfile() as object
|
|||
if maxResSetting = "auto"
|
||||
maxVideoHeight = m.global.device.videoHeight
|
||||
maxVideoWidth = m.global.device.videoWidth
|
||||
else if maxResSetting = "360"
|
||||
maxVideoWidth = "480"
|
||||
else if maxResSetting = "480"
|
||||
maxVideoWidth = "640"
|
||||
else if maxResSetting = "720"
|
||||
maxVideoWidth = "1280"
|
||||
else if maxResSetting = "1080"
|
||||
maxVideoWidth = "1920"
|
||||
else if maxResSetting = "2160"
|
||||
maxVideoWidth = "3840"
|
||||
else if maxResSetting = "4320"
|
||||
maxVideoWidth = "7680"
|
||||
else if maxResSetting <> "off"
|
||||
if maxResSetting = "360"
|
||||
maxVideoWidth = "480"
|
||||
else if maxResSetting = "480"
|
||||
maxVideoWidth = "640"
|
||||
else if maxResSetting = "720"
|
||||
maxVideoWidth = "1280"
|
||||
else if maxResSetting = "1080"
|
||||
maxVideoWidth = "1920"
|
||||
else if maxResSetting = "2160"
|
||||
maxVideoWidth = "3840"
|
||||
else if maxResSetting = "4320"
|
||||
maxVideoWidth = "7680"
|
||||
end if
|
||||
end if
|
||||
|
||||
maxVideoHeightArray = {
|
||||
|
@ -878,7 +880,7 @@ end function
|
|||
|
||||
function GetBitRateLimit(codec as string) as object
|
||||
if m.global.session.user.settings["playback.bitrate.maxlimited"] = true
|
||||
userSetLimit = m.global.session.user.settings["playback.bitrate.limit"]
|
||||
userSetLimit = m.global.session.user.settings["playback.bitrate.limit"].ToInt()
|
||||
if isValid(userSetLimit) and type(userSetLimit) = "Integer" and userSetLimit > 0
|
||||
userSetLimit *= 1000000
|
||||
return {
|
||||
|
|
|
@ -234,25 +234,17 @@ namespace session
|
|||
end sub
|
||||
|
||||
' Saves the user setting to the global session.
|
||||
' This also converts strings to boolean and integer as necessary before saving to global session
|
||||
' This also converts strings to boolean as necessary before saving to global session
|
||||
sub Save(name as string, value as string)
|
||||
if name = invalid or value = invalid then return
|
||||
tmpSettingArray = m.global.session.user.settings
|
||||
convertedValue = value
|
||||
|
||||
' convert to int
|
||||
valueInteger = value.ToInt()
|
||||
if value = "0" or valueInteger <> 0
|
||||
convertedValue = valueInteger
|
||||
end if
|
||||
|
||||
' convert to boolean
|
||||
if type(value) = "String"
|
||||
if value = "true"
|
||||
convertedValue = true
|
||||
else if value = "false"
|
||||
convertedValue = false
|
||||
end if
|
||||
if value = "true"
|
||||
convertedValue = true
|
||||
else if value = "false"
|
||||
convertedValue = false
|
||||
end if
|
||||
|
||||
tmpSettingArray[name] = convertedValue
|
||||
|
|
Loading…
Reference in New Issue
Block a user