mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Add script offset / delay to Handy support. (#1573)
* Add script offset / delay to Handy support. Further work on #1376. Offsets are added to the current video position, so a positive value leads to earlier motion. (The most common setting.) This is needed because most script times have a consistent delay when compared to the video. (Delay from the API calls to the server should be handled by the server offset calculation.) * Rename scriptOffset to funscriptOffset * Correct localisation keys Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
50217f6318
commit
45a9aabdaf
@@ -37,6 +37,7 @@ export const SettingsInterfacePanel: React.FC = () => {
|
||||
const [cssEnabled, setCSSEnabled] = useState<boolean>(false);
|
||||
const [language, setLanguage] = useState<string>("en");
|
||||
const [handyKey, setHandyKey] = useState<string>();
|
||||
const [funscriptOffset, setFunscriptOffset] = useState<number>(0);
|
||||
|
||||
const [updateInterfaceConfig] = useConfigureInterface({
|
||||
menuItems: menuItemIds,
|
||||
@@ -51,6 +52,7 @@ export const SettingsInterfacePanel: React.FC = () => {
|
||||
language,
|
||||
slideshowDelay,
|
||||
handyKey,
|
||||
funscriptOffset,
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
@@ -67,6 +69,7 @@ export const SettingsInterfacePanel: React.FC = () => {
|
||||
setLanguage(iCfg?.language ?? "en-US");
|
||||
setSlideshowDelay(iCfg?.slideshowDelay ?? 5000);
|
||||
setHandyKey(iCfg?.handyKey ?? "");
|
||||
setFunscriptOffset(iCfg?.funscriptOffset ?? 0);
|
||||
}, [config]);
|
||||
|
||||
async function onSave() {
|
||||
@@ -281,7 +284,9 @@ export const SettingsInterfacePanel: React.FC = () => {
|
||||
</Form.Group>
|
||||
|
||||
<Form.Group>
|
||||
<h5>{intl.formatMessage({ id: "config.ui.handy_connection_key" })}</h5>
|
||||
<h5>
|
||||
{intl.formatMessage({ id: "config.ui.handy_connection_key.heading" })}
|
||||
</h5>
|
||||
<Form.Control
|
||||
className="col col-sm-6 text-input"
|
||||
value={handyKey}
|
||||
@@ -290,7 +295,25 @@ export const SettingsInterfacePanel: React.FC = () => {
|
||||
}}
|
||||
/>
|
||||
<Form.Text className="text-muted">
|
||||
{intl.formatMessage({ id: "config.ui.handy_connection_key_desc" })}
|
||||
{intl.formatMessage({
|
||||
id: "config.ui.handy_connection_key.description",
|
||||
})}
|
||||
</Form.Text>
|
||||
</Form.Group>
|
||||
<Form.Group>
|
||||
<h5>
|
||||
{intl.formatMessage({ id: "config.ui.funscript_offset.heading" })}
|
||||
</h5>
|
||||
<Form.Control
|
||||
className="col col-sm-6 text-input"
|
||||
type="number"
|
||||
value={funscriptOffset}
|
||||
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
|
||||
setFunscriptOffset(Number.parseInt(e.currentTarget.value, 10));
|
||||
}}
|
||||
/>
|
||||
<Form.Text className="text-muted">
|
||||
{intl.formatMessage({ id: "config.ui.funscript_offset.description" })}
|
||||
</Form.Text>
|
||||
</Form.Group>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user