From 1976274513795f0c6ac6bee50ebb9d8982af57bc Mon Sep 17 00:00:00 2001 From: Izzie Walton Date: Thu, 6 Jun 2024 17:20:52 -0400 Subject: [PATCH] Always use external web client. --- .github/workflows/main.yml | 8 +-- README.md | 11 ++- debian-webclient-rules | 15 ---- deployment/build.debian | 1 - download_webclient.sh | 75 -------------------- for-web-developers.md | 4 +- resources/settings/settings_description.json | 6 -- src/CMakeLists.txt | 6 -- src/settings/SettingsComponent.cpp | 30 +------- src/settings/SettingsComponent.h | 1 - src/ui/webview.qml | 2 +- 11 files changed, 12 insertions(+), 147 deletions(-) delete mode 100755 debian-webclient-rules delete mode 100755 download_webclient.sh diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fea3cf9..9b686d9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,7 +17,7 @@ jobs: brew install ninja mpv qt@5 || true - name: Release build run: | - ./download_webclient.sh + mkdir build sed -i '' 's|await loadScript('\''qrc:///qtwebchannel/qwebchannel.js'\'');|document.body.style.overscrollBehavior = "none";&|g' native/nativeshell.js cd build cmake -GNinja -DQTROOT=/usr/local/opt/qt@5 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=output .. @@ -45,7 +45,7 @@ jobs: brew install ninja mpv qt@5 || true - name: Release build run: | - ./download_webclient.sh + mkdir build sed -i '' 's|await loadScript('\''qrc:///qtwebchannel/qwebchannel.js'\'');|document.body.style.overscrollBehavior = "none";&|g' native/nativeshell.js cd build cmake -GNinja -DQTROOT=/opt/homebrew/opt/qt@5 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=output .. @@ -75,7 +75,7 @@ jobs: modules: "qtwebengine" - name: Install dependencies run: | - ./download_webclient.sh + mkdir build curl -L https://aka.ms/vs/17/release/vc_redist.x64.exe > vc_redist.x64.exe sed -i 's#C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Redist\\MSVC\\v142\\vcredist_x64.exe#'"$(readlink -f vc_redist.x64.exe | sed 's#/\([a-z]\)/#\1:\\#g' | tr '/' '\\' | sed 's/\\/\\\\/g')#g" bundle/win/Bundle.wxs curl -L https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip > ninja.zip @@ -119,7 +119,7 @@ jobs: modules: "qtwebengine" - name: Install dependencies run: | - ./download_webclient.sh + mkdir build curl -L https://aka.ms/vs/17/release/vc_redist.x86.exe > vc_redist.x86.exe sed -i 's#C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Redist\\MSVC\\v142\\vcredist_x64.exe#'"$(readlink -f vc_redist.x86.exe | sed 's#/\([a-z]\)/#\1:\\#g' | tr '/' '\\' | sed 's/\\/\\\\/g')#g" bundle/win/Bundle.wxs curl -L https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip > ninja.zip diff --git a/README.md b/README.md index cdddcc0..d2a05c8 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,7 @@ Downloads: - [Flathub (Linux)](https://flathub.org/apps/details/com.github.iwalton3.jellyfin-media-player) Related Documents: - - Web client: https://repo.jellyfin.org/releases/server/portable/versions/stable/web/ - - Note: If you do not provide the web client, the application will use a fallback UI where the user must select a server which has a web client. + - Web client: Application uses server-provided web client. - Web client integration documentation: [for-web-developers.md](https://github.com/jellyfin/jellyfin-media-player/blob/master/for-web-developers.md) - API Docs in [client-api.md](https://github.com/jellyfin/jellyfin-media-player/blob/master/client-api.md) - Tip: For help building, look at the GitHub Actions file! @@ -50,7 +49,7 @@ sudo ldconfig cd ~/jmp/ git clone https://github.com/jellyfin/jellyfin-media-player.git cd jellyfin-media-player -./download_webclient.sh +mkdir build cd build cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr/local/ -G Ninja .. ninja @@ -83,7 +82,7 @@ sudo ldconfig cd ~/jmp/ git clone https://github.com/jellyfin/jellyfin-media-player.git cd jellyfin-media-player/ -./download_webclient.sh +mkdir build cd build/ cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr/local/ .. make -j`nproc` @@ -113,7 +112,7 @@ You need to run these commands in git bash. ```bash git clone https://github.com/jellyfin/jellyfin-media-player cd jellyfin-media-player -./download_webclient.sh +mkdir build cd build ``` @@ -135,7 +134,7 @@ Then run the following commands (replace with your QT installation loca ```bash brew install mpv ninja -./download_webclient.sh +mkdir build cd build cmake -GNinja -DQTROOT= -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=output .. ninja install diff --git a/debian-webclient-rules b/debian-webclient-rules deleted file mode 100755 index 13644c2..0000000 --- a/debian-webclient-rules +++ /dev/null @@ -1,15 +0,0 @@ -#! /usr/bin/make -f - -%: - dh $@ - -override_dh_auto_configure: - DOWNLOAD_ONLY=1 ./download_webclient.sh - tar -xzf dist.tar.gz - mkdir obj-x86_64-linux-gnu - mv jellyfin/jellyfin-web obj-x86_64-linux-gnu/dist - dh_auto_configure $@ - -override_dh_auto_clean: - dh_auto_clean $@ - rm dist.tar.gz || true diff --git a/deployment/build.debian b/deployment/build.debian index 98edff5..75e51c1 100755 --- a/deployment/build.debian +++ b/deployment/build.debian @@ -5,7 +5,6 @@ set -o xtrace # move to source directory pushd ${SOURCE_DIR} -cp debian-webclient-rules ./debian/rules # install deps echo y | mk-build-deps -i diff --git a/download_webclient.sh b/download_webclient.sh deleted file mode 100755 index dde6acc..0000000 --- a/download_webclient.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash -cd "$(dirname "$0")" - -function download_compat { - if [[ "$AZ_CACHE" != "" ]] - then - download_id=$(echo "$2" | md5sum | sed 's/ .*//g') - if [[ -e "$AZ_CACHE/$3/$download_id" ]] - then - echo "Cache hit: $AZ_CACHE/$3/$download_id" - cp "$AZ_CACHE/$3/$download_id" "$1" - return - elif [[ "$3" != "" ]] - then - rm -r "$AZ_CACHE/$3" 2> /dev/null - fi - fi - if [[ "$(which wget 2>/dev/null)" != "" ]] - then - wget -qO "$1" "$2" - else [[ "$(which curl)" != "" ]] - curl -sL "$2" > "$1" - fi - if [[ "$AZ_CACHE" != "" ]] - then - echo "Saving to: $AZ_CACHE/$3/$download_id" - mkdir -p "$AZ_CACHE/$3/" - cp "$1" "$AZ_CACHE/$3/$download_id" - fi -} - -function get_webclient_version { - curl https://repo.jellyfin.org/files/server/portable/latest-stable/any/ | - tr '<>/' '\t' | grep '[0-9]\+\.[0-9]\+\.[0-9]\+' | cut -f 3 | cut -d_ -f2 | - sed 's/\.[a-z][a-z]*//g' | sort -V | tail -n 1 -} - -if [[ "$1" == "--gen-fingerprint" ]] -then - ( - get_webclient_version - ) | tee az-cache-fingerprint.list - exit 0 -fi - -# Download web client -update_web_client="no" -mkdir -p build -if [[ ! -e "build/dist" ]] -then - update_web_client="yes" -elif [[ -e ".last_wc_version" ]] -then - if [[ "$(get_webclient_version)" != "$(cat .last_wc_version)" ]] - then - update_web_client="yes" - fi -fi - -if [[ "$update_web_client" == "yes" ]] -then - echo "Downloading web client..." - wc_version=$(get_webclient_version) - download_compat dist.tar.gz "https://repo.jellyfin.org/files/server/portable/latest-stable/any/jellyfin_${wc_version}.tar.gz" "wc" - if [[ "$DOWNLOAD_ONLY" != "1" ]] - then - rm -r build/dist 2> /dev/null - rm -r dist 2> /dev/null - tar -xvf dist.tar.gz > /dev/null && rm dist.tar.gz - mv "jellyfin/jellyfin-web" build/dist - rm -r jellyfin - fi - echo "$wc_version" > .last_wc_version -fi - diff --git a/for-web-developers.md b/for-web-developers.md index 81bd667..c2631f2 100644 --- a/for-web-developers.md +++ b/for-web-developers.md @@ -153,8 +153,6 @@ Current Settings: - `checkForUpdates: boolean`: Allows user to disable update check plugin script. - This has no effect if you don't use the update script. - `enableInputRepeat: boolean`: Allows disabling repeating of control inputs. - - `forceExternalWebclient: boolean`: Allows the user to connect to external webclients even if the bundled one is available. - - This has not landed in a released version yet. - `userWebClient: string`: Hidden option. Set it back to an empty string to allow the user to select a different webclient path. - Plugins Section (`plugins`): - `skipintro: boolean`: Enables or disabled the plugin. You likely won't use this. @@ -196,7 +194,7 @@ Current Settings: - `aspect: string enum`: Allows control of aspect ratio. The default is `normal`. - Options: `normal`, `zoom`, `force_4_3`, `force_16_9`, `force_16_9_if_4_3`, `stretch`, `noscaling`, `custom` - Subtitle Section (`subtitles`): - - `ass_scale_border_and_shadow`: Controls whether or not ASS subtitles scale their border and shadow with the video resolution. Default `true` + - `ass_scale_border_and_shadow`: Controls whether or not ASS subtitles scale their border and shadow with the video resolution. Default `true` - `ass_style_override: string enum`: Controls whether user style override should be applied to ASS subtitles. Default: `` - Provided options: [see enum](https://github.com/jellyfin/jellyfin-media-player/blob/7d5943becc1ca672d599887cac9107836c38d337/resources/settings/settings_description.json#L412-L419) - `placement: string enum`: Controls where subtitles are displayed on the screen. Default: `` diff --git a/resources/settings/settings_description.json b/resources/settings/settings_description.json index 323af53..0d8cf1f 100644 --- a/resources/settings/settings_description.json +++ b/resources/settings/settings_description.json @@ -147,12 +147,6 @@ "default": false, "platforms": [ "linux" ] }, - { - "value": "forceExternalWebclient", - "display_name": "Force External Web Client", - "help": "Allows the user to connect to external webclients even if the bundled one is available.", - "default": false - }, { "value": "userWebClient", "default": "", diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index de26fbf..9df49da 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -106,9 +106,6 @@ endif() set(RESOURCE_ROOT .) if(APPLE) set(RESOURCE_ROOT Resources) - if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/../dist/) - add_resources(TARGET ${MAIN_TARGET} SOURCES ${CMAKE_CURRENT_BINARY_DIR}/../dist/ DEST ${RESOURCE_ROOT}/web-client/desktop) - endif() add_resources(TARGET ${MAIN_TARGET} SOURCES ${CMAKE_SOURCE_DIR}/native/ DEST ${RESOURCE_ROOT}/web-client/extension) endif() @@ -122,9 +119,6 @@ if(NOT APPLE) install(FILES ${loc}/qtwebengine_devtools_resources.pak DESTINATION resources) endif() endforeach() - if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/../dist/) - install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../dist/ DESTINATION ${INSTALL_RESOURCE_DIR}/web-client/desktop) - endif() install(DIRECTORY ${CMAKE_SOURCE_DIR}/native/ DESTINATION ${INSTALL_RESOURCE_DIR}/web-client/extension) endif() diff --git a/src/settings/SettingsComponent.cpp b/src/settings/SettingsComponent.cpp index a16f2b8..c398523 100644 --- a/src/settings/SettingsComponent.cpp +++ b/src/settings/SettingsComponent.cpp @@ -739,28 +739,6 @@ bool SettingsComponent::resetAndSaveOldConfiguration() return settingsFile.rename(Paths::dataDir("jellyfinmediaplayer.conf.old")); } - -///////////////////////////////////////////////////////////////////////////////////////// -bool SettingsComponent::isUsingExternalWebClient() -{ - QString url; - - url = SettingsComponent::Get().value(SETTINGS_SECTION_PATH, "startupurl_desktop").toString(); - - if (url == "bundled") - { - auto path = Paths::webClientPath("desktop"); - QFileInfo check_file(path); - if (SettingsComponent::Get().value(SETTINGS_SECTION_MAIN, "forceExternalWebclient").toBool() || - !(check_file.exists() && check_file.isFile())) { - // use built-in fallback - return true; - } - } - - return false; -} - ///////////////////////////////////////////////////////////////////////////////////////// QString SettingsComponent::getWebClientUrl(bool desktop) { @@ -770,13 +748,7 @@ QString SettingsComponent::getWebClientUrl(bool desktop) if (url == "bundled") { - auto path = Paths::webClientPath("desktop"); - QFileInfo check_file(path); - if (SettingsComponent::Get().value(SETTINGS_SECTION_MAIN, "forceExternalWebclient").toBool() || - !(check_file.exists() && check_file.isFile())) { - // use built-in fallback - path = Paths::webExtensionPath() + "find-webclient.html"; - } + auto path = Paths::webExtensionPath() + "find-webclient.html"; url = "file:///" + path; } diff --git a/src/settings/SettingsComponent.h b/src/settings/SettingsComponent.h index 4eda34e..6019c33 100644 --- a/src/settings/SettingsComponent.h +++ b/src/settings/SettingsComponent.h @@ -61,7 +61,6 @@ public: Q_INVOKABLE QVariantList settingDescriptions(); Q_INVOKABLE QString getWebClientUrl(bool desktop); Q_INVOKABLE QString getExtensionPath(); - Q_INVOKABLE bool isUsingExternalWebClient(); Q_INVOKABLE QString getClientName(); Q_INVOKABLE bool ignoreSSLErrors(); Q_INVOKABLE bool autodetectCertBundle(); diff --git a/src/ui/webview.qml b/src/ui/webview.qml index 1df1e77..9f7902b 100644 --- a/src/ui/webview.qml +++ b/src/ui/webview.qml @@ -146,7 +146,7 @@ KonvergoWindow settings.errorPageEnabled: false settings.localContentCanAccessRemoteUrls: true settings.localContentCanAccessFileUrls: true - settings.allowRunningInsecureContent: components.settings.isUsingExternalWebClient() + settings.allowRunningInsecureContent: true settings.playbackRequiresUserGesture: false profile.httpUserAgent: components.system.getUserAgent() url: mainWindow.webUrl