mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-21 15:52:02 +00:00
add proxy streams setting
This commit is contained in:
parent
4d97ed946a
commit
4480423731
2 changed files with 39 additions and 1 deletions
|
|
@ -47,6 +47,7 @@ const Settings = () => {
|
||||||
} = useProfileSettingsInputs(profile);
|
} = useProfileSettingsInputs(profile);
|
||||||
const {
|
const {
|
||||||
streamingServerRemoteUrlInput,
|
streamingServerRemoteUrlInput,
|
||||||
|
proxyStreamsCheckbox,
|
||||||
remoteEndpointSelect,
|
remoteEndpointSelect,
|
||||||
cacheSizeSelect,
|
cacheSizeSelect,
|
||||||
torrentProfileSelect,
|
torrentProfileSelect,
|
||||||
|
|
@ -627,6 +628,21 @@ const Settings = () => {
|
||||||
:
|
:
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
proxyStreamsCheckbox !== null ?
|
||||||
|
<div className={styles['option-container']}>
|
||||||
|
<div className={styles['option-name-container']}>
|
||||||
|
<div className={styles['label']}>{ t('SETTINGS_PROXY_STREAMS') }</div>
|
||||||
|
</div>
|
||||||
|
<Checkbox
|
||||||
|
className={classnames(styles['option-input-container'], styles['checkbox-container'])}
|
||||||
|
tabIndex={-1}
|
||||||
|
{...proxyStreamsCheckbox}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
:
|
||||||
|
null
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
<div ref={shortcutsSectionRef} className={styles['section-container']}>
|
<div ref={shortcutsSectionRef} className={styles['section-container']}>
|
||||||
<div className={styles['section-title']}>{ t('SETTINGS_NAV_SHORTCUTS') }</div>
|
<div className={styles['section-title']}>{ t('SETTINGS_NAV_SHORTCUTS') }</div>
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,28 @@ const useStreamingServerSettingsInputs = (streamingServer) => {
|
||||||
value: streamingServer.remoteUrl,
|
value: streamingServer.remoteUrl,
|
||||||
}), [streamingServer.remoteUrl]);
|
}), [streamingServer.remoteUrl]);
|
||||||
|
|
||||||
|
const proxyStreamsCheckbox = React.useMemo(() => {
|
||||||
|
if (streamingServer.settings?.type !== 'Ready') {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
checked: streamingServer.settings.content.proxyStreamsEnabled,
|
||||||
|
onClick: () => {
|
||||||
|
core.transport.dispatch({
|
||||||
|
action: 'StreamingServer',
|
||||||
|
args: {
|
||||||
|
action: 'UpdateSettings',
|
||||||
|
args: {
|
||||||
|
...streamingServer.settings.content,
|
||||||
|
proxyStreamsEnabled: !streamingServer.settings.content.proxyStreamsEnabled
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [streamingServer.settings]);
|
||||||
|
|
||||||
const remoteEndpointSelect = React.useMemo(() => {
|
const remoteEndpointSelect = React.useMemo(() => {
|
||||||
if (streamingServer.settings?.type !== 'Ready' || streamingServer.networkInfo?.type !== 'Ready') {
|
if (streamingServer.settings?.type !== 'Ready' || streamingServer.networkInfo?.type !== 'Ready') {
|
||||||
return null;
|
return null;
|
||||||
|
|
@ -198,7 +220,7 @@ const useStreamingServerSettingsInputs = (streamingServer) => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}, [streamingServer.settings, streamingServer.deviceInfo]);
|
}, [streamingServer.settings, streamingServer.deviceInfo]);
|
||||||
return { streamingServerRemoteUrlInput, remoteEndpointSelect, cacheSizeSelect, torrentProfileSelect, transcodingProfileSelect };
|
return { streamingServerRemoteUrlInput, proxyStreamsCheckbox, remoteEndpointSelect, cacheSizeSelect, torrentProfileSelect, transcodingProfileSelect };
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = useStreamingServerSettingsInputs;
|
module.exports = useStreamingServerSettingsInputs;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue