PATCH missing function call from paths.py
Caused the following calls to treat as a direct function object instead of the return from the function
This commit is contained in:
@@ -13,9 +13,9 @@ def get_state_file_path() -> Path:
|
|||||||
return state_dir() / "state.json"
|
return state_dir() / "state.json"
|
||||||
|
|
||||||
def load_state() -> dict:
|
def load_state() -> dict:
|
||||||
if not get_state_file_path.exists():
|
if not get_state_file_path().exists():
|
||||||
return {"files": []}
|
return {"files": []}
|
||||||
with get_state_file_path.open() as f:
|
with get_state_file_path().open() as f:
|
||||||
return json.load(f)
|
return json.load(f)
|
||||||
|
|
||||||
def write_state(state: dict):
|
def write_state(state: dict):
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
import os, subprocess, datetime, json
|
import os, subprocess, datetime, json
|
||||||
|
|
||||||
from rewind.paths import get_state_file
|
from rewind.paths import load_state
|
||||||
|
|
||||||
STATE_FILE = get_state_file()
|
|
||||||
|
|
||||||
def save(seconds, output_file):
|
def save(seconds, output_file):
|
||||||
ts_files = STATE_FILE.get("files", [])
|
ts_files = load_state().get("files", [])
|
||||||
ts_files[-1]["duration"] = get_duration(ts_files[-1]["path"])
|
ts_files[-1]["duration"] = get_duration(ts_files[-1]["path"])
|
||||||
|
|
||||||
total_duration = 0.0
|
total_duration = 0.0
|
||||||
|
|||||||
Reference in New Issue
Block a user