mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-03-11 21:27:05 +00:00
change cache size implemented
This commit is contained in:
parent
9169f177de
commit
45c7c4ab33
1 changed files with 15 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
|||
const React = require('react');
|
||||
const isEqual = require('lodash.isequal');
|
||||
const { useServices } = require('stremio/services');
|
||||
const { useStreamingServer } = require('stremio/common');
|
||||
|
||||
const CACHE_SIZES = [0, 2147483648, 5368709120, 10737418240, null];
|
||||
|
|
@ -42,6 +43,7 @@ const TORRENT_PROFILES = {
|
|||
};
|
||||
|
||||
const useStreaminServerSettingsInputs = () => {
|
||||
const { core } = useServices();
|
||||
const streaminServer = useStreamingServer();
|
||||
const cacheSizeSelect = React.useMemo(() => {
|
||||
if (streaminServer.type !== 'Ready') {
|
||||
|
|
@ -56,9 +58,21 @@ const useStreaminServerSettingsInputs = () => {
|
|||
selected: [JSON.stringify(streaminServer.settings.cacheSize)],
|
||||
renderLabelText: () => {
|
||||
return cacheSizeToString(streaminServer.settings.cacheSize);
|
||||
},
|
||||
onSelect: (event) => {
|
||||
core.dispatch({
|
||||
action: 'Ctx',
|
||||
args: {
|
||||
action: 'UpdateSettings',
|
||||
args: {
|
||||
...streaminServer.settings,
|
||||
cacheSize: JSON.parse(event.value)
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}, [streaminServer.type, streaminServer.settings && streaminServer.settings.cacheSize]);
|
||||
}, [streaminServer.type, streaminServer.settings]);
|
||||
const torrentProfileSelect = React.useMemo(() => {
|
||||
if (streaminServer.type !== 'Ready') {
|
||||
return null;
|
||||
|
|
|
|||
Loading…
Reference in a new issue