Always use external web client.

This commit is contained in:
Izzie Walton 2024-06-06 17:20:52 -04:00
parent 3cb0d4a3cf
commit 1976274513
11 changed files with 12 additions and 147 deletions

View File

@ -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

View File

@ -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 <QT_DIR> with your QT installation loca
```bash
brew install mpv ninja
./download_webclient.sh
mkdir build
cd build
cmake -GNinja -DQTROOT=<QT_DIR> -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=output ..
ninja install

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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: ``

View File

@ -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": "",

View File

@ -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()

View File

@ -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;
}

View File

@ -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();

View File

@ -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