From 499810b3fae16da99ff1efdbf768e78814389023 Mon Sep 17 00:00:00 2001 From: jmawet Date: Fri, 7 Aug 2026 22:07:44 -0700 Subject: [PATCH 1/2] fix skip length unit conversion when syncing to/from moonbase --- source/utils/settingsSync.bs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/source/utils/settingsSync.bs b/source/utils/settingsSync.bs index 36b9541cb..84bb6a855 100644 --- a/source/utils/settingsSync.bs +++ b/source/utils/settingsSync.bs @@ -167,7 +167,13 @@ namespace settingsSync pluginValue = profile[mapping.pluginKey] if not isValid(pluginValue) then continue for - rokuValue = settingsSync.PluginToRoku(pluginValue, mapping.type) + if mapping.pluginKey = "skipForwardLength" or mapping.pluginKey = "skipBackLength" + newValue = pluginValue / 1000 + else + newValue = pluginValue + end if + + rokuValue = settingsSync.PluginToRoku(newValue, mapping.type) if not isValid(rokuValue) then continue for tmpSettings[mapping.rokuKey] = toBoolean(rokuValue) @@ -301,10 +307,16 @@ namespace settingsSync sub PushToServer(rokuKey as string, rokuValue as dynamic) if not settingsSync.IsSyncEnabled() then return + if rokuKey = "playback.skipForwardLength" or rokuKey = "playback.skipBackLength" + newValue = rokuValue * 1000 + else + newValue = rokuValue + end if + mapping = settingsSync.FindMappingByRokuKey(rokuKey) if not isValid(mapping) if Left(rokuKey, 10) = "seerr.row." - pushData = settingsSync.PreparePush(rokuKey, rokuValue) + pushData = settingsSync.PreparePush(rokuKey, newValue) if isValid(pushData) task = createObject("roSGNode", "PostTask") task.apiUrl = pushData.url @@ -315,7 +327,7 @@ namespace settingsSync return end if - pluginValue = settingsSync.RokuToPlugin(rokuValue, mapping.type) + pluginValue = settingsSync.RokuToPlugin(newValue, mapping.type) if not isValid(pluginValue) then return profileData = {} From b785f6fd4b761eb9ed2b49bdc558f325b317a0e4 Mon Sep 17 00:00:00 2001 From: RadicalMuffinMan <103554043+RadicalMuffinMan@users.noreply.github.com> Date: Tue, 11 Aug 2026 16:57:49 -0400 Subject: [PATCH 2/2] Convert skip lengths between seconds and milliseconds during sync --- source/utils/settingsSync.bs | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/source/utils/settingsSync.bs b/source/utils/settingsSync.bs index 84bb6a855..9c33642ad 100644 --- a/source/utils/settingsSync.bs +++ b/source/utils/settingsSync.bs @@ -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" }, @@ -167,13 +167,7 @@ namespace settingsSync pluginValue = profile[mapping.pluginKey] if not isValid(pluginValue) then continue for - if mapping.pluginKey = "skipForwardLength" or mapping.pluginKey = "skipBackLength" - newValue = pluginValue / 1000 - else - newValue = pluginValue - end if - - rokuValue = settingsSync.PluginToRoku(newValue, mapping.type) + rokuValue = settingsSync.PluginToRoku(pluginValue, mapping.type) if not isValid(rokuValue) then continue for tmpSettings[mapping.rokuKey] = toBoolean(rokuValue) @@ -307,16 +301,10 @@ namespace settingsSync sub PushToServer(rokuKey as string, rokuValue as dynamic) if not settingsSync.IsSyncEnabled() then return - if rokuKey = "playback.skipForwardLength" or rokuKey = "playback.skipBackLength" - newValue = rokuValue * 1000 - else - newValue = rokuValue - end if - mapping = settingsSync.FindMappingByRokuKey(rokuKey) if not isValid(mapping) if Left(rokuKey, 10) = "seerr.row." - pushData = settingsSync.PreparePush(rokuKey, newValue) + pushData = settingsSync.PreparePush(rokuKey, rokuValue) if isValid(pushData) task = createObject("roSGNode", "PostTask") task.apiUrl = pushData.url @@ -327,7 +315,7 @@ namespace settingsSync return end if - pluginValue = settingsSync.RokuToPlugin(newValue, mapping.type) + pluginValue = settingsSync.RokuToPlugin(rokuValue, mapping.type) if not isValid(pluginValue) then return profileData = {} @@ -443,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) @@ -501,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"