Skip to content

Commit 9fb4929

Browse files
author
arch
committed
improve OFS integration
1 parent 0d3f634 commit 9fb4929

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

contrib/OpenFunscripter/funscript_generator_linux.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@ Settings.PythonScript = "/home/arch/Repos/public/Python-Funscript-Editor/funscri
33
Settings.TmpFile = "/tmp/funscript_actions.csv"
44
SetSettings(Settings)
55

6-
-- Version: 1.2.0
6+
-- Version: 1.3.0
77
function GetActions(video)
88
local at = {}
99
local pos = {}
1010
local next_action = CurrentScript:GetClosestActionAfter(CurrentTimeMs)
11+
if not next_action == nil and next_action.at < CurrentTimeMs + 500.0 then
12+
next_action = CurrentScript:GetClosestActionAfter(next_action.at)
13+
end
1114
local command = 'python3 "'..Settings.PythonScript..'" --generator -s '..(next_action == nil and tostring(CurrentTimeMs) or tostring(CurrentTimeMs)..' -e '..tostring(next_action.at))..' -i "'..video..'" -o "'..Settings.TmpFile..'"'
1215
print(command)
1316
os.execute(command)

contrib/OpenFunscripter/funscript_generator.lua renamed to contrib/OpenFunscripter/funscript_generator_windows.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@ Settings.FunscriptGenerator = 'C:/Users/win10/Desktop/funscript-editor/funscript
33
Settings.TmpFile = 'C:/Users/win10/AppData/Local/Temp/funscript_actions.csv' -- file where to temporary store the result (must be a file not a directory!)
44
SetSettings(Settings)
55

6-
-- Version: 1.1.0
6+
-- Version: 1.3.0
77
function GetActions(video)
88
local at = {}
99
local pos = {}
1010
local next_action = CurrentScript:GetClosestActionAfter(CurrentTimeMs)
11+
if not next_action == nil and next_action.at < CurrentTimeMs + 500.0 then
12+
next_action = CurrentScript:GetClosestActionAfter(next_action.at)
13+
end
1114
local command = '""'..Settings.FunscriptGenerator..'" --generator -s '..(next_action == nil and tostring(CurrentTimeMs) or tostring(CurrentTimeMs)..' -e '..tostring(next_action.at))..' -i "'..video..'" -o "'..Settings.TmpFile..'"'
1215
print(command)
1316
os.execute(command)

funscript_editor/utils/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ def read_version() -> str:
2727
version_file = os.path.join(ROOT_DIR, 'VERSION.txt')
2828
if os.path.exists(version_file):
2929
with open(version_file, 'r') as f:
30-
return f.read().replace('v', '').strip()
30+
version = f.read().lower().replace('v', '').strip()
31+
if version != "": return version
3132
return "0.0.0"
3233

3334
#: the package version

0 commit comments

Comments
 (0)