diff --git a/package-lock.json b/package-lock.json index 40445e199..e9e5e32bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -36,7 +36,7 @@ "react-i18next": "^12.1.1", "react-is": "18.2.0", "spatial-navigation-polyfill": "github:Stremio/spatial-navigation#64871b1422466f5f45d24ebc8bbd315b2ebab6a6", - "stremio-translations": "github:Stremio/stremio-translations#aa51ad5bba2db9275236eba2736f0e6b9d91e08f", + "stremio-translations": "github:Stremio/stremio-translations#b13b3e2653bd0dcf644d2a20ffa32074fe6532dd", "url": "0.11.0", "use-long-press": "^3.1.5" }, @@ -12470,9 +12470,9 @@ } }, "node_modules/stremio-translations": { - "version": "1.44.5", - "resolved": "git+ssh://git@github.com/Stremio/stremio-translations.git#aa51ad5bba2db9275236eba2736f0e6b9d91e08f", - "integrity": "sha512-mgdeEUol79mzrSiNHppbmJfk/nGtHfBWvAj3S/T03jJHA0aCjPx4bs0v2KX4xuBUbQQSSlDq56j/F4tpUlJpUg==", + "version": "1.44.7", + "resolved": "git+ssh://git@github.com/Stremio/stremio-translations.git#b13b3e2653bd0dcf644d2a20ffa32074fe6532dd", + "integrity": "sha512-OtRAM3j9ie89llgI379p4utCbgnNMswE+LtL/lyLRVLfm5B+jpBLp4ozpU25iQg0O4tvN+OHBjXZ870CCHtZMA==", "license": "MIT" }, "node_modules/string_decoder": { diff --git a/package.json b/package.json index cc0fdb2c0..8a0d076a4 100755 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "react-i18next": "^12.1.1", "react-is": "18.2.0", "spatial-navigation-polyfill": "github:Stremio/spatial-navigation#64871b1422466f5f45d24ebc8bbd315b2ebab6a6", - "stremio-translations": "github:Stremio/stremio-translations#aa51ad5bba2db9275236eba2736f0e6b9d91e08f", + "stremio-translations": "github:Stremio/stremio-translations#b13b3e2653bd0dcf644d2a20ffa32074fe6532dd", "url": "0.11.0", "use-long-press": "^3.1.5" }, diff --git a/src/routes/Settings/Settings.js b/src/routes/Settings/Settings.js index c920e4ed5..9dc6e3556 100644 --- a/src/routes/Settings/Settings.js +++ b/src/routes/Settings/Settings.js @@ -49,7 +49,8 @@ const Settings = () => { streamingServerRemoteUrlInput, remoteEndpointSelect, cacheSizeSelect, - torrentProfileSelect + torrentProfileSelect, + transcodingProfileSelect, } = useStreamingServerSettingsInputs(streamingServer); const [configureServerUrlModalOpen, openConfigureServerUrlModal, closeConfigureServerUrlModal] = useBinaryState(false); const configureServerUrlInputRef = React.useRef(null); @@ -612,6 +613,20 @@ const Settings = () => { : null } + { + transcodingProfileSelect !== null ? +
+
+
{ t('SETTINGS_TRANSCODE_PROFILE') }
+
+ +
+ : + null + }
{ t('SETTINGS_NAV_SHORTCUTS') }
diff --git a/src/routes/Settings/useStreamingServerSettingsInputs.js b/src/routes/Settings/useStreamingServerSettingsInputs.js index 0b612083c..32fb971a5 100644 --- a/src/routes/Settings/useStreamingServerSettingsInputs.js +++ b/src/routes/Settings/useStreamingServerSettingsInputs.js @@ -167,7 +167,38 @@ const useStreamingServerSettingsInputs = (streamingServer) => { } }; }, [streamingServer.settings]); - return { streamingServerRemoteUrlInput, remoteEndpointSelect, cacheSizeSelect, torrentProfileSelect }; + const transcodingProfileSelect = React.useMemo(() => { + if (streamingServer.settings?.type !== 'Ready' || streamingServer.deviceInfo?.type !== 'Ready') { + return null; + } + + return { + options: [ + { + label: t('SETTINGS_DISABLED'), + value: null, + }, + ...streamingServer.deviceInfo.content.availableHardwareAccelerations.map((name) => ({ + label: name, + value: name, + })) + ], + selected: [streamingServer.settings.content.transcodeProfile], + onSelect: (event) => { + core.transport.dispatch({ + action: 'StreamingServer', + args: { + action: 'UpdateSettings', + args: { + ...streamingServer.settings.content, + transcodeProfile: event.value, + } + } + }); + } + }; + }, [streamingServer.settings, streamingServer.deviceInfo]); + return { streamingServerRemoteUrlInput, remoteEndpointSelect, cacheSizeSelect, torrentProfileSelect, transcodingProfileSelect }; }; module.exports = useStreamingServerSettingsInputs;