Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions source/utils/settingsSync.bs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ namespace settingsSync
{ pluginKey: "autoplayNextEpisode", rokuKey: "playback.showNextUpAfterFinish", type: "bool" },
{ pluginKey: "resumeSubtractDuration", rokuKey: "playback.resumeRewind", type: "intToStr" },
{ pluginKey: "unpauseRewindDuration", rokuKey: "playback.unpauseRewind", type: "intToStr" },
{ pluginKey: "skipBackLength", rokuKey: "playback.skipBackLength", type: "intToStr" },
{ pluginKey: "skipForwardLength", rokuKey: "playback.skipForwardLength", type: "intToStr" },
{ pluginKey: "skipBackLength", rokuKey: "playback.skipBackLength", type: "secondsToMs" },
{ pluginKey: "skipForwardLength", rokuKey: "playback.skipForwardLength", type: "secondsToMs" },
{ pluginKey: "preferAudioDescription", rokuKey: "playback.preferAudioDescription", type: "bool" },
{ pluginKey: "preferSdhSubtitles", rokuKey: "playback.preferSdhSubtitles", type: "bool" },
{ pluginKey: "seerrBlockNsfw", rokuKey: "seerr.blockNsfw", type: "bool" },
Expand Down Expand Up @@ -431,6 +431,13 @@ namespace settingsSync
return isTrue ? "false" : "true"
else if conversionType = "intToStr"
return pluginValue.toStr()
else if conversionType = "secondsToMs"
' A reading under a second is already in seconds, since the smallest value stored
' as milliseconds is 1000
raw = val(pluginValue.toStr())
if raw <= 0 then return invalid
if raw >= 1000 then raw = raw / 1000
return int(raw).toStr()
else if conversionType = "jsonArray"
if type(pluginValue) = "roArray" or type(pluginValue) = "Array"
return FormatJson(pluginValue)
Expand Down Expand Up @@ -489,6 +496,10 @@ namespace settingsSync
return not (LCase(rokuStr) = "true")
else if conversionType = "intToStr"
return val(rokuStr)
else if conversionType = "secondsToMs"
seconds = int(val(rokuStr))
if seconds <= 0 then return invalid
return seconds * 1000
else if conversionType = "jsonArray"
parsed = ParseJson(rokuStr)
if type(parsed) = "roArray" or type(parsed) = "Array"
Expand Down