From 38365339f00fc1431203c0dbd667b13884937ea2 Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 21 Mar 2024 22:11:05 +0100 Subject: [PATCH 1/3] feat: implement transcoding profile --- src/routes/Settings/Settings.js | 17 +++++++++- .../useStreamingServerSettingsInputs.js | 33 ++++++++++++++++++- 2 files changed, 48 insertions(+), 2 deletions(-) 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; From 1312e1d5b7193ef150a2783aa4af0b79c244686d Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 25 Mar 2024 18:35:54 +0100 Subject: [PATCH 2/3] chore: update core-web --- package-lock.json | 26 +++++++++++++++++++++----- package.json | 2 +- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3b2684f62..c94ec1ead 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@babel/runtime": "7.16.0", "@sentry/browser": "6.13.3", "@stremio/stremio-colors": "5.0.1", - "@stremio/stremio-core-web": "0.47.0", + "@stremio/stremio-core-web": "0.47.2", "@stremio/stremio-icons": "5.2.0", "@stremio/stremio-video": "0.0.38", "a-color-picker": "1.2.1", @@ -2969,13 +2969,29 @@ "license": "MIT" }, "node_modules/@stremio/stremio-core-web": { - "version": "0.47.0", - "resolved": "https://registry.npmjs.org/@stremio/stremio-core-web/-/stremio-core-web-0.47.0.tgz", - "integrity": "sha512-//wXNpVFnKjVegPjAKPLz+SanGvk/p+4cuDAvZst5igi+wCw/wbsxOssq8HZbq1QvaeFQdpttW0HXbkzLcyf8Q==", + "version": "0.47.2", + "resolved": "https://registry.npmjs.org/@stremio/stremio-core-web/-/stremio-core-web-0.47.2.tgz", + "integrity": "sha512-kJXkshXT5f5go137id9MHrVA7PfHao2pGSxfEBbMDGFCqAVfF4jRFTXmfLC0cS1R+EjYhajUrSsXnEddtb2c7g==", "dependencies": { - "@babel/runtime": "7.16.0" + "@babel/runtime": "7.24.1" } }, + "node_modules/@stremio/stremio-core-web/node_modules/@babel/runtime": { + "version": "7.24.1", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.1.tgz", + "integrity": "sha512-+BIznRzyqBf+2wCTxcKE3wDjfGeCoVE61KSHGpkzqrLi8qxqFwBeUFyId2cxkTmm55fzDGnm0+yCxaxygrLUnQ==", + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@stremio/stremio-core-web/node_modules/regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==" + }, "node_modules/@stremio/stremio-icons": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/@stremio/stremio-icons/-/stremio-icons-5.2.0.tgz", diff --git a/package.json b/package.json index dca1280da..698d6d785 100755 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "@babel/runtime": "7.16.0", "@sentry/browser": "6.13.3", "@stremio/stremio-colors": "5.0.1", - "@stremio/stremio-core-web": "0.47.0", + "@stremio/stremio-core-web": "0.47.2", "@stremio/stremio-icons": "5.2.0", "@stremio/stremio-video": "0.0.38", "a-color-picker": "1.2.1", From 8c71c95572189b04c5e47e1d0713b67b93c28368 Mon Sep 17 00:00:00 2001 From: Tim Date: Thu, 28 Mar 2024 04:13:09 +0100 Subject: [PATCH 3/3] chore: update stremio-translations --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index c94ec1ead..e4be07f3f 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#38d283adf4bbe6d29657b5023778e30af7f6b05a", + "stremio-translations": "github:Stremio/stremio-translations#b13b3e2653bd0dcf644d2a20ffa32074fe6532dd", "url": "0.11.0", "use-long-press": "^3.1.5" }, @@ -12468,9 +12468,9 @@ } }, "node_modules/stremio-translations": { - "version": "1.44.5", - "resolved": "git+ssh://git@github.com/Stremio/stremio-translations.git#38d283adf4bbe6d29657b5023778e30af7f6b05a", - "integrity": "sha512-O/uFENWQ/pXEw4hQ1XQ8e4g6ZeX80wrhrxZfaGq2svK2I3bC/gCe5et0lbVzFBkVefSP3o1BMrlhgoSqfQssqA==", + "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 698d6d785..9fe5c85d1 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#38d283adf4bbe6d29657b5023778e30af7f6b05a", + "stremio-translations": "github:Stremio/stremio-translations#b13b3e2653bd0dcf644d2a20ffa32074fe6532dd", "url": "0.11.0", "use-long-press": "^3.1.5" },