mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-16 23:40:10 +08:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0c9486f6b4 | ||
|
|
576740a502 | ||
|
|
b3f9f43b57 | ||
|
|
e7424bcc66 | ||
|
|
209ec70ea9 | ||
|
|
3b4e251034 | ||
|
|
86beb879a2 | ||
|
|
321d434141 | ||
|
|
b9d17e27b1 | ||
|
|
2f6f6da6c0 |
23
.github/workflows/build.yml
vendored
23
.github/workflows/build.yml
vendored
@@ -41,12 +41,6 @@ on:
|
||||
default: true
|
||||
type: boolean
|
||||
|
||||
build_linux_arm64:
|
||||
description: "Build Linux-arm64"
|
||||
required: false
|
||||
default: true
|
||||
type: boolean
|
||||
|
||||
tag:
|
||||
description: "tag"
|
||||
required: false
|
||||
@@ -116,7 +110,7 @@ jobs:
|
||||
shell: bash
|
||||
|
||||
- name: Release
|
||||
if: ${{ github.event.inputs.tag != '' }}
|
||||
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag != '' }}
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: ${{ github.event.inputs.tag }}
|
||||
@@ -150,32 +144,25 @@ jobs:
|
||||
uses: ./.github/workflows/ios.yml
|
||||
permissions: write-all
|
||||
with:
|
||||
tag: github.event.inputs.tag
|
||||
tag: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || '' }}
|
||||
|
||||
mac:
|
||||
if: ${{ github.event_name == 'pull_request' || github.event.inputs.build_mac == 'true' }}
|
||||
uses: ./.github/workflows/mac.yml
|
||||
permissions: write-all
|
||||
with:
|
||||
tag: github.event.inputs.tag
|
||||
tag: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || '' }}
|
||||
|
||||
win_x64:
|
||||
if: ${{ github.event_name == 'pull_request' || github.event.inputs.build_win_x64 == 'true' }}
|
||||
uses: ./.github/workflows/win_x64.yml
|
||||
permissions: write-all
|
||||
with:
|
||||
tag: github.event.inputs.tag
|
||||
tag: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || '' }}
|
||||
|
||||
linux_x64:
|
||||
if: ${{ github.event_name == 'pull_request' || github.event.inputs.build_linux_x64 == 'true' }}
|
||||
uses: ./.github/workflows/linux_x64.yml
|
||||
permissions: write-all
|
||||
with:
|
||||
tag: github.event.inputs.tag
|
||||
|
||||
linux_arm64:
|
||||
if: ${{ github.event_name == 'pull_request' || github.event.inputs.build_linux_arm64 == 'true' }}
|
||||
uses: ./.github/workflows/linux_arm64.yml
|
||||
permissions: write-all
|
||||
with:
|
||||
tag: github.event.inputs.tag
|
||||
tag: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.tag || '' }}
|
||||
|
||||
260
.github/workflows/linux_arm64.yml
vendored
260
.github/workflows/linux_arm64.yml
vendored
@@ -1,260 +0,0 @@
|
||||
name: Build for Linux Arm64
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
tag:
|
||||
description: "tag"
|
||||
required: false
|
||||
default: ""
|
||||
type: string
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-linux-app:
|
||||
name: Release Linux Arm64
|
||||
runs-on: ubuntu-24.04-arm
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v5
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y clang cmake libgtk-3-dev ninja-build libayatana-appindicator3-dev unzip webkit2gtk-4.1 libasound2-dev rpm patchelf
|
||||
sudo apt-get install -y gcc g++ autoconf automake debhelper glslang-dev ladspa-sdk xutils-dev libasound2-dev \
|
||||
libarchive-dev libbluray-dev libbs2b-dev libcaca-dev libcdio-paranoia-dev libdrm-dev \
|
||||
libdav1d-dev libdvdnav-dev libegl1-mesa-dev libepoxy-dev libfontconfig-dev libfreetype6-dev \
|
||||
libfribidi-dev libgl1-mesa-dev libgbm-dev libgme-dev libgsm1-dev libharfbuzz-dev libjpeg-dev \
|
||||
libbrotli-dev liblcms2-dev libmodplug-dev libmp3lame-dev libopenal-dev \
|
||||
libopus-dev libopencore-amrnb-dev libopencore-amrwb-dev libpulse-dev librtmp-dev \
|
||||
libsdl2-dev libsixel-dev libssh-dev libsoxr-dev libspeex-dev libtool \
|
||||
libv4l-dev libva-dev libvdpau-dev libvorbis-dev libvo-amrwbenc-dev \
|
||||
libunwind-dev libvpx-dev libwayland-dev libx11-dev libxext-dev \
|
||||
libxkbcommon-dev libxrandr-dev libxss-dev libxv-dev libxvidcore-dev \
|
||||
linux-libc-dev nasm ninja-build pkg-config python3 python3-docutils wayland-protocols \
|
||||
x11proto-core-dev zlib1g-dev libfdk-aac-dev libtheora-dev libwebp-dev \
|
||||
unixodbc-dev libpq-dev libxxhash-dev libaom-dev \
|
||||
libgtk-3-0 libblkid1 liblzma5 libmpv-dev
|
||||
shell: bash
|
||||
|
||||
- name: Setup flutter
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: master
|
||||
flutter-version-file: pubspec.yaml
|
||||
cache: true
|
||||
|
||||
- name: Set and Extract version
|
||||
shell: pwsh
|
||||
run: lib/scripts/build.ps1
|
||||
|
||||
#TODO: deb and rpm packages need to be build
|
||||
- name: Build Linux
|
||||
run: flutter build linux --release -v --pub --dart-define-from-file=pili_release.json
|
||||
|
||||
- name: Package .tar.gz
|
||||
run: tar -zcvf PiliPlus_linux_${{ env.version }}_arm64.tar.gz -C build/linux/arm64/release/bundle .
|
||||
|
||||
- name: Packege deb
|
||||
run: |
|
||||
printf "建立构建目录...\n"
|
||||
mkdir "PiliPlus_linux_${{ env.version }}_arm64"
|
||||
pushd "PiliPlus_linux_${{ env.version }}_arm64"
|
||||
mkdir -p opt/PiliPlus
|
||||
mkdir -p usr/share/applications
|
||||
mkdir -p usr/share/icons/hicolor/512x512/apps
|
||||
|
||||
printf "复制文件...\n"
|
||||
cp -r ../build/linux/arm64/release/bundle/* opt/PiliPlus
|
||||
cp -r ../assets/linux/DEBIAN .
|
||||
cp ../assets/linux/piliplus.desktop usr/share/applications
|
||||
cp ../assets/images/logo/logo.png usr/share/icons/hicolor/512x512/apps/piliplus.png
|
||||
|
||||
printf "修改控制文件...\n"
|
||||
# 替换版本号
|
||||
sed -i "2s/version_need_change/${{ env.version }}/g" DEBIAN/control
|
||||
# 计算安装大小并替换
|
||||
SIZE_KB=$(du -s -b --apparent-size . | awk '{print int($1)}')
|
||||
SIZE_KB=$(($SIZE_KB - $(du -s -b --apparent-size DEBIAN | awk '{print int($1)}')))
|
||||
SIZE_KB=$(echo $SIZE_KB | awk '{print int($1/1024 + 0.999)}')
|
||||
printf "\t安装大小: %s KB\n" "$SIZE_KB"
|
||||
sed -i "9s/size_need_change/${SIZE_KB}/g" DEBIAN/control
|
||||
|
||||
printf "生成并写入 md5sums ...\n"
|
||||
md5sum opt/PiliPlus/piliplus >> DEBIAN/md5sums
|
||||
md5sum opt/PiliPlus/lib/* >> DEBIAN/md5sums
|
||||
md5sum opt/PiliPlus/data/icudtl.dat >> DEBIAN/md5sums
|
||||
|
||||
printf "设置权限...\n"
|
||||
chmod 0644 DEBIAN/control
|
||||
chmod 0644 DEBIAN/md5sums
|
||||
chmod 0755 DEBIAN/postinst
|
||||
chmod 0755 DEBIAN/postrm
|
||||
chmod 0755 DEBIAN/prerm
|
||||
|
||||
printf "打包 deb 文件...\n"
|
||||
popd
|
||||
dpkg-deb --build --verbose --root-owner-group "PiliPlus_linux_${{ env.version }}_arm64"
|
||||
printf "完成: PiliPlus_linux_%s_arm64.deb\n" "${{ env.version }}"
|
||||
shell: bash
|
||||
|
||||
- name: Packege rpm
|
||||
run: |
|
||||
printf "建立 RPM 构建目录...\n"
|
||||
RPM_BUILD_ROOT="$PWD/rpm_build"
|
||||
mkdir -p "$RPM_BUILD_ROOT/BUILD" "$RPM_BUILD_ROOT/RPMS" "$RPM_BUILD_ROOT/SOURCES" "$RPM_BUILD_ROOT/SPECS" "$RPM_BUILD_ROOT/SRPMS"
|
||||
|
||||
printf "准备源码归档(仅包含运行时与元数据)...\n"
|
||||
DATE="$(date '+%a %b %d %Y')"
|
||||
SRC_DIR="$PWD/piliplus-${{ env.version }}"
|
||||
mkdir -p "$SRC_DIR/bundle" "$SRC_DIR/assets"
|
||||
cp -r build/linux/arm64/release/bundle/* "$SRC_DIR/bundle/"
|
||||
cp assets/linux/piliplus.desktop "$SRC_DIR/assets/piliplus.desktop"
|
||||
cp assets/images/logo/logo.png "$SRC_DIR/assets/piliplus.png"
|
||||
tar -zcvf "$RPM_BUILD_ROOT/SOURCES/piliplus-${{ env.version }}.tar.gz" -C "$PWD" "piliplus-${{ env.version }}"
|
||||
|
||||
printf "生成 spec 文件...\n"
|
||||
cat > "$RPM_BUILD_ROOT/SPECS/piliplus.spec" <<EOF
|
||||
Name: piliplus
|
||||
Version: ${{ env.version }}
|
||||
Release: 1%{?dist}
|
||||
Summary: PiliPlus Linux Version
|
||||
License: GPL-3.0
|
||||
Source0: piliplus-${{ env.version }}.tar.gz
|
||||
Requires: desktop-file-utils, hicolor-icon-theme
|
||||
|
||||
%description
|
||||
使用 Flutter 开发的 BiliBili 第三方客户端
|
||||
|
||||
%prep
|
||||
%setup -q -n piliplus-${{ env.version }}
|
||||
|
||||
%build
|
||||
|
||||
%install
|
||||
mkdir -p %{buildroot}/opt/PiliPlus
|
||||
cp -r bundle/* %{buildroot}/opt/PiliPlus/
|
||||
|
||||
# 二进制权限与命令行入口
|
||||
chmod 755 %{buildroot}/opt/PiliPlus/piliplus
|
||||
mkdir -p %{buildroot}/usr/bin
|
||||
ln -sf /opt/PiliPlus/piliplus %{buildroot}/usr/bin/piliplus
|
||||
|
||||
# 桌面集成
|
||||
mkdir -p %{buildroot}/usr/share/applications
|
||||
install -m 644 assets/piliplus.desktop %{buildroot}/usr/share/applications/piliplus.desktop
|
||||
|
||||
mkdir -p %{buildroot}/usr/share/icons/hicolor/512x512/apps
|
||||
install -m 644 assets/piliplus.png %{buildroot}/usr/share/icons/hicolor/512x512/apps/piliplus.png
|
||||
|
||||
%post
|
||||
update-desktop-database -q || true
|
||||
gtk-update-icon-cache -q -t -f %{_datadir}/icons/hicolor || true
|
||||
|
||||
%postun
|
||||
update-desktop-database -q || true
|
||||
gtk-update-icon-cache -q -t -f %{_datadir}/icons/hicolor || true
|
||||
|
||||
%files
|
||||
/opt/PiliPlus
|
||||
/usr/bin/piliplus
|
||||
/usr/share/applications/piliplus.desktop
|
||||
/usr/share/icons/hicolor/512x512/apps/piliplus.png
|
||||
|
||||
%changelog
|
||||
* DATE - ${{ env.version }}-1
|
||||
- Initial RPM release
|
||||
EOF
|
||||
|
||||
sed -i "s/DATE/${DATE}/g" "$RPM_BUILD_ROOT/SPECS/piliplus.spec"
|
||||
|
||||
printf "构建 RPM 包...\n"
|
||||
rpmbuild --define "_topdir $RPM_BUILD_ROOT" -bb "$RPM_BUILD_ROOT/SPECS/piliplus.spec"
|
||||
|
||||
printf "移动生成的 RPM...\n"
|
||||
find "$RPM_BUILD_ROOT/RPMS" -name "*.rpm" -exec mv {} "PiliPlus_linux_${{ env.version }}_arm64.rpm" \;
|
||||
|
||||
printf "完成: PiliPlus_linux_%s_arm64.rpm\n" "${{ env.version }}"
|
||||
shell: bash
|
||||
|
||||
- name: Package AppImage
|
||||
run: |
|
||||
printf "下载 appimagetool (ARM64)...\n"
|
||||
wget -q https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-aarch64.AppImage
|
||||
chmod +x appimagetool-aarch64.AppImage
|
||||
|
||||
printf "建立 AppDir 目录结构...\n"
|
||||
APPDIR="PiliPlus.AppDir"
|
||||
mkdir -p "$APPDIR/usr/bin"
|
||||
mkdir -p "$APPDIR/usr/lib"
|
||||
mkdir -p "$APPDIR/usr/share/applications"
|
||||
mkdir -p "$APPDIR/usr/share/icons/hicolor/512x512/apps"
|
||||
|
||||
printf "复制应用文件...\n"
|
||||
cp -r build/linux/arm64/release/bundle/* "$APPDIR/usr/bin/"
|
||||
|
||||
printf "复制桌面文件和图标...\n"
|
||||
cp assets/linux/piliplus.desktop "$APPDIR/piliplus.desktop"
|
||||
cp assets/linux/piliplus.desktop "$APPDIR/usr/share/applications/piliplus.desktop"
|
||||
cp assets/images/logo/logo.png "$APPDIR/piliplus.png"
|
||||
cp assets/images/logo/logo.png "$APPDIR/usr/share/icons/hicolor/512x512/apps/piliplus.png"
|
||||
|
||||
printf "创建 AppRun 启动脚本...\n"
|
||||
cat > "$APPDIR/AppRun" <<'APPRUN_EOF'
|
||||
#!/bin/bash
|
||||
SELF=$(readlink -f "$0")
|
||||
HERE=${SELF%/*}
|
||||
export PATH="${HERE}/usr/bin:${PATH}"
|
||||
export LD_LIBRARY_PATH="${HERE}/usr/lib:${LD_LIBRARY_PATH}"
|
||||
exec "${HERE}/usr/bin/piliplus" "$@"
|
||||
APPRUN_EOF
|
||||
chmod +x "$APPDIR/AppRun"
|
||||
|
||||
printf "修改桌面文件中的 Exec 路径...\n"
|
||||
sed -i 's|Exec=piliplus|Exec=piliplus|g' "$APPDIR/piliplus.desktop"
|
||||
sed -i 's|Icon=piliplus|Icon=piliplus|g' "$APPDIR/piliplus.desktop"
|
||||
|
||||
printf "打包 AppImage...\n"
|
||||
ARCH=aarch64 ./appimagetool-aarch64.AppImage "$APPDIR" "PiliPlus_linux_${{ env.version }}_arm64.AppImage"
|
||||
|
||||
printf "完成: PiliPlus_linux_%s_arm64.AppImage\n" "${{ env.version }}"
|
||||
shell: bash
|
||||
|
||||
- name: Release
|
||||
if: ${{ github.event.inputs.tag != '' }}
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
tag_name: ${{ github.event.inputs.tag }}
|
||||
name: ${{ github.event.inputs.tag }}
|
||||
files: |
|
||||
PiliPlus_linux_*.tar.gz
|
||||
PiliPlus_linux_*.deb
|
||||
PiliPlus_linux_*.rpm
|
||||
PiliPlus_linux_*.AppImage
|
||||
|
||||
- name: Upload linux targz package
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Linux_targz_arm64_packege
|
||||
path: PiliPlus_linux_*.tar.gz
|
||||
|
||||
- name: Upload linux deb package
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Linux_deb_arm64_package
|
||||
path: PiliPlus_linux_*.deb
|
||||
|
||||
- name: Upload linux rpm package
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Linux_rpm_arm64_package
|
||||
path: PiliPlus_linux_*.rpm
|
||||
|
||||
- name: Upload linux AppImage package
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: Linux_AppImage_arm64_package
|
||||
path: PiliPlus_linux_*.AppImage
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'package:PiliPlus/http/constants.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class StyleString {
|
||||
@@ -43,7 +42,7 @@ class Constants {
|
||||
static const baseHeaders = {
|
||||
'connection': 'keep-alive',
|
||||
'accept-encoding': 'br,gzip',
|
||||
'referer': HttpString.baseUrl,
|
||||
// 'referer': HttpString.baseUrl,
|
||||
'env': 'prod',
|
||||
'app-key': 'android64',
|
||||
'x-bili-aurora-zone': 'sh001',
|
||||
|
||||
@@ -8,7 +8,7 @@ class ImmediateTapGestureRecognizer extends OneSequenceGestureRecognizer {
|
||||
super.allowedButtonsFilter,
|
||||
this.onTapDown,
|
||||
required this.onTapUp,
|
||||
required this.onTapCancel,
|
||||
this.onTapCancel,
|
||||
this.onTap,
|
||||
});
|
||||
|
||||
@@ -16,7 +16,7 @@ class ImmediateTapGestureRecognizer extends OneSequenceGestureRecognizer {
|
||||
|
||||
final GestureTapUpCallback onTapUp;
|
||||
|
||||
final GestureTapCancelCallback onTapCancel;
|
||||
final GestureTapCancelCallback? onTapCancel;
|
||||
|
||||
final GestureTapCallback? onTap;
|
||||
|
||||
@@ -100,8 +100,8 @@ class ImmediateTapGestureRecognizer extends OneSequenceGestureRecognizer {
|
||||
}
|
||||
|
||||
void _cancelGesture(String reason) {
|
||||
if (_sentTapDown) {
|
||||
invokeCallback<void>('onTapCancel: $reason', onTapCancel);
|
||||
if (_sentTapDown && onTapCancel != null) {
|
||||
invokeCallback<void>('onTapCancel: $reason', onTapCancel!);
|
||||
}
|
||||
_reset();
|
||||
}
|
||||
|
||||
@@ -80,7 +80,10 @@ class Request {
|
||||
await Request().post(
|
||||
Api.activateBuvidApi,
|
||||
data: {'payload': jsonData},
|
||||
options: Options(contentType: Headers.jsonContentType),
|
||||
options: Options(
|
||||
extra: {'account': account},
|
||||
contentType: Headers.jsonContentType,
|
||||
),
|
||||
);
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ import 'dart:convert';
|
||||
import 'package:PiliPlus/http/api.dart';
|
||||
import 'package:PiliPlus/http/init.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/http/ua_type.dart';
|
||||
import 'package:PiliPlus/models/common/search/search_type.dart';
|
||||
import 'package:PiliPlus/models/search/result.dart';
|
||||
import 'package:PiliPlus/models/search/suggest.dart';
|
||||
@@ -56,7 +55,6 @@ class SearchHttp {
|
||||
int? categoryId,
|
||||
int? pubBegin,
|
||||
int? pubEnd,
|
||||
required String qvId,
|
||||
String? gaiaVtoken,
|
||||
required ValueChanged<String> onSuccess,
|
||||
}) async {
|
||||
@@ -72,16 +70,8 @@ class SearchHttp {
|
||||
'category_id': ?categoryId,
|
||||
'pubtime_begin_s': ?pubBegin,
|
||||
'pubtime_end_s': ?pubEnd,
|
||||
// 'ad_resource': 5654,
|
||||
'__refresh__': true,
|
||||
'_extra': '',
|
||||
'context': '',
|
||||
'page_size': 20,
|
||||
'from_source': '',
|
||||
'from_spmid': 333.337,
|
||||
'platform': 'pc',
|
||||
'source_tag': 3,
|
||||
'qv_id': qvId,
|
||||
'web_location': 1430654,
|
||||
'gaia_vtoken': ?gaiaVtoken,
|
||||
});
|
||||
@@ -91,10 +81,9 @@ class SearchHttp {
|
||||
options: Options(
|
||||
headers: {
|
||||
if (gaiaVtoken != null) 'cookie': 'x-bili-gaia-vtoken=$gaiaVtoken',
|
||||
'user-agent': UaType.pc.ua,
|
||||
'origin': 'https://search.bilibili.com',
|
||||
'referer':
|
||||
'https://search.bilibili.com/${searchType.name}?keyword=$keyword',
|
||||
'https://search.bilibili.com/${searchType.name}?keyword=${Uri.encodeQueryComponent(keyword)}',
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
@@ -604,6 +604,7 @@ class AudioController extends GetxController
|
||||
itemType = item.itemType;
|
||||
_queryPlayUrl().then((res) {
|
||||
if (res) {
|
||||
_videoDetailController = null;
|
||||
_updateCurrItem(audioItem);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -169,27 +169,28 @@ class BottomControl extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
ComBtn(
|
||||
height: 30,
|
||||
tooltip: isFullScreen ? '退出全屏' : '全屏',
|
||||
icon: isFullScreen
|
||||
? const Icon(
|
||||
Icons.fullscreen_exit,
|
||||
size: 24,
|
||||
color: Colors.white,
|
||||
)
|
||||
: const Icon(
|
||||
Icons.fullscreen,
|
||||
size: 24,
|
||||
color: Colors.white,
|
||||
),
|
||||
onTap: () =>
|
||||
plPlayerController.triggerFullScreen(status: !isFullScreen),
|
||||
onSecondaryTap: () => plPlayerController.triggerFullScreen(
|
||||
status: !isFullScreen,
|
||||
inAppFullScreen: true,
|
||||
if (!plPlayerController.isDesktopPip)
|
||||
ComBtn(
|
||||
height: 30,
|
||||
tooltip: isFullScreen ? '退出全屏' : '全屏',
|
||||
icon: isFullScreen
|
||||
? const Icon(
|
||||
Icons.fullscreen_exit,
|
||||
size: 24,
|
||||
color: Colors.white,
|
||||
)
|
||||
: const Icon(
|
||||
Icons.fullscreen,
|
||||
size: 24,
|
||||
color: Colors.white,
|
||||
),
|
||||
onTap: () =>
|
||||
plPlayerController.triggerFullScreen(status: !isFullScreen),
|
||||
onSecondaryTap: () => plPlayerController.triggerFullScreen(
|
||||
status: !isFullScreen,
|
||||
inAppFullScreen: true,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -110,7 +110,7 @@ class LiveHeaderControl extends StatelessWidget {
|
||||
);
|
||||
},
|
||||
),
|
||||
if (Platform.isAndroid || Utils.isDesktop)
|
||||
if (Platform.isAndroid || (Utils.isDesktop && !isFullScreen))
|
||||
ComBtn(
|
||||
tooltip: '画中画',
|
||||
onTap: () async {
|
||||
|
||||
@@ -8,7 +8,6 @@ import 'package:PiliPlus/models/search/result.dart';
|
||||
import 'package:PiliPlus/pages/common/common_list_controller.dart';
|
||||
import 'package:PiliPlus/pages/search_result/controller.dart';
|
||||
import 'package:PiliPlus/utils/extension.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@@ -83,8 +82,6 @@ class SearchPanelController<R extends SearchNumData<T>, T>
|
||||
return false;
|
||||
}
|
||||
|
||||
final qvId = Utils.generateRandomString(32);
|
||||
|
||||
String? gaiaVtoken;
|
||||
|
||||
@override
|
||||
@@ -100,7 +97,6 @@ class SearchPanelController<R extends SearchNumData<T>, T>
|
||||
categoryId: articleZoneType?.value.categoryId,
|
||||
pubBegin: pubBegin,
|
||||
pubEnd: pubEnd,
|
||||
qvId: qvId,
|
||||
gaiaVtoken: gaiaVtoken,
|
||||
onSuccess: (String gaiaVtoken) {
|
||||
this.gaiaVtoken = gaiaVtoken;
|
||||
|
||||
@@ -69,7 +69,7 @@ class VideoReplyReplyPanel extends CommonSlidePage {
|
||||
onPressed: uri == null
|
||||
? null
|
||||
: () => PiliScheme.routePush(uri, businessId: type),
|
||||
icon: const Icon(Icons.open_in_new),
|
||||
icon: const Icon(Icons.open_in_browser),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -2450,7 +2450,7 @@ class HeaderControlState extends State<HeaderControl> {
|
||||
),
|
||||
),
|
||||
],
|
||||
if (Platform.isAndroid || Utils.isDesktop)
|
||||
if (Platform.isAndroid || (Utils.isDesktop && !isFullScreen))
|
||||
SizedBox(
|
||||
width: 42,
|
||||
height: 34,
|
||||
|
||||
@@ -180,7 +180,7 @@ class PlayerFocus extends StatelessWidget {
|
||||
return true;
|
||||
|
||||
case LogicalKeyboardKey.keyP:
|
||||
if (Utils.isDesktop && hasPlayer) {
|
||||
if (Utils.isDesktop && hasPlayer && !isFullScreen) {
|
||||
plPlayerController
|
||||
..toggleDesktopPip()
|
||||
..controlsLock.value = false;
|
||||
|
||||
@@ -281,6 +281,8 @@ class PlPlayerController {
|
||||
}
|
||||
|
||||
Future<void> enterDesktopPip() async {
|
||||
if (isFullScreen.value) return;
|
||||
|
||||
isDesktopPip = true;
|
||||
|
||||
_lastWindowBounds = await windowManager.getBounds();
|
||||
@@ -1572,6 +1574,7 @@ class PlPlayerController {
|
||||
bool isManualFS = true,
|
||||
FullScreenMode? mode,
|
||||
}) async {
|
||||
if (isDesktopPip) return;
|
||||
if (isFullScreen.value == status) return;
|
||||
|
||||
if (fsProcessing) {
|
||||
|
||||
@@ -152,13 +152,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
WakelockPlus.enable();
|
||||
}
|
||||
wakeLock = player?.stream.playing.listen(
|
||||
(value) {
|
||||
if (value) {
|
||||
WakelockPlus.enable();
|
||||
} else {
|
||||
WakelockPlus.disable();
|
||||
}
|
||||
},
|
||||
(v) => WakelockPlus.toggle(enable: v),
|
||||
);
|
||||
|
||||
_controlsListener = plPlayerController.showControls.listen((bool val) {
|
||||
@@ -234,11 +228,13 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
|
||||
_danmakuListener = plPlayerController.enableShowDanmaku.listen((value) {
|
||||
if (!value) _removeDmAction();
|
||||
(_tapGestureRecognizer as ImmediateTapGestureRecognizer).onTapDown =
|
||||
value ? _onTapDown : null;
|
||||
_tapGestureRecognizer.onTapDown = value ? _onTapDown : null;
|
||||
});
|
||||
} else {
|
||||
_tapGestureRecognizer = TapGestureRecognizer()..onTapUp = _onTapUp;
|
||||
_tapGestureRecognizer = ImmediateTapGestureRecognizer(
|
||||
onTapUp: _onTapUp,
|
||||
allowedButtonsFilter: (buttons) => buttons == kPrimaryButton,
|
||||
);
|
||||
}
|
||||
|
||||
_doubleTapGestureRecognizer = DoubleTapGestureRecognizer()
|
||||
@@ -847,7 +843,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
BottomControlType.subtitle,
|
||||
BottomControlType.speed,
|
||||
if (flag) BottomControlType.qa,
|
||||
BottomControlType.fullscreen,
|
||||
if (!plPlayerController.isDesktopPip) BottomControlType.fullscreen,
|
||||
];
|
||||
|
||||
return Row(
|
||||
@@ -1160,12 +1156,10 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
final item = ctr.findSingleDanmaku(pos);
|
||||
if (item == null) {
|
||||
_suspendedDm?.suspend = false;
|
||||
_suspendedDm = null;
|
||||
_dmOffset.value = null;
|
||||
} else if (item != _suspendedDm) {
|
||||
_suspendedDm?.suspend = false;
|
||||
if (item.content.extra == null) {
|
||||
_suspendedDm = null;
|
||||
_dmOffset.value = null;
|
||||
return;
|
||||
}
|
||||
@@ -1197,7 +1191,7 @@ class _PLVideoPlayerState extends State<PLVideoPlayer>
|
||||
..onLongPressEnd = ((_) => plPlayerController.setLongPressStatus(false))
|
||||
..onLongPressCancel = (() =>
|
||||
plPlayerController.setLongPressStatus(false));
|
||||
late final OneSequenceGestureRecognizer _tapGestureRecognizer;
|
||||
late final ImmediateTapGestureRecognizer _tapGestureRecognizer;
|
||||
late final DoubleTapGestureRecognizer _doubleTapGestureRecognizer;
|
||||
StreamSubscription<bool>? _danmakuListener;
|
||||
|
||||
|
||||
@@ -163,7 +163,9 @@ class AccountManager extends Interceptor {
|
||||
);
|
||||
}
|
||||
|
||||
options.headers.addAll(account.headers);
|
||||
options.headers
|
||||
..addAll(account.headers)
|
||||
..['referer'] ??= HttpString.baseUrl;
|
||||
|
||||
// app端不需要管理cookie
|
||||
if (path.startsWith(HttpString.appBaseUrl)) {
|
||||
|
||||
@@ -132,7 +132,10 @@ class ReplyUtils {
|
||||
if (!isManual)
|
||||
TextButton(
|
||||
onPressed: Get.back,
|
||||
child: const Text('关闭'),
|
||||
child: Text(
|
||||
'关闭',
|
||||
style: TextStyle(color: Get.theme.colorScheme.outline),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -346,7 +346,10 @@ abstract class RequestUtils {
|
||||
if (!isManual)
|
||||
TextButton(
|
||||
onPressed: Get.back,
|
||||
child: const Text('关闭'),
|
||||
child: Text(
|
||||
'关闭',
|
||||
style: TextStyle(color: Get.theme.colorScheme.outline),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
52
windows/packaging/exe/inno_setup.iss
Normal file
52
windows/packaging/exe/inno_setup.iss
Normal file
@@ -0,0 +1,52 @@
|
||||
[Setup]
|
||||
AppId={{APP_ID}}
|
||||
AppVersion={{APP_VERSION}}
|
||||
AppName={{DISPLAY_NAME}}
|
||||
AppPublisher={{PUBLISHER_NAME}}
|
||||
AppPublisherURL={{PUBLISHER_URL}}
|
||||
AppSupportURL={{PUBLISHER_URL}}
|
||||
AppUpdatesURL={{PUBLISHER_URL}}
|
||||
DefaultDirName={{INSTALL_DIR_NAME}}
|
||||
DisableProgramGroupPage=yes
|
||||
OutputDir=.
|
||||
OutputBaseFilename={{OUTPUT_BASE_FILENAME}}
|
||||
Compression=lzma
|
||||
SolidCompression=yes
|
||||
SetupIconFile={{SETUP_ICON_FILE}}
|
||||
WizardStyle=modern
|
||||
PrivilegesRequired={{PRIVILEGES_REQUIRED}}
|
||||
ArchitecturesAllowed=x64
|
||||
ArchitecturesInstallIn64BitMode=x64
|
||||
|
||||
[Code]
|
||||
procedure KillOldProcess;
|
||||
var ResultCode: Integer;
|
||||
begin
|
||||
Exec('taskkill', '/F /IM {{EXECUTABLE_NAME}}', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
|
||||
end;
|
||||
|
||||
function InitializeSetup(): Boolean;
|
||||
begin
|
||||
KillOldProcess;
|
||||
Result := True;
|
||||
end;
|
||||
|
||||
[Languages]
|
||||
Name: "english"; MessagesFile: "compiler:Default.isl"
|
||||
Name: "chinesesimplified"; MessagesFile: "compiler:Languages\ChineseSimplified.isl"
|
||||
|
||||
[Tasks]
|
||||
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkedonce
|
||||
Name: "launchAtStartup"; Description: "{cm:AutoStartProgram,{{DISPLAY_NAME}}}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
|
||||
|
||||
[Files]
|
||||
Source: "{{SOURCE_DIR}}\\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
||||
|
||||
[Icons]
|
||||
Name: "{autoprograms}\\{{DISPLAY_NAME}}"; Filename: "{app}\\{{EXECUTABLE_NAME}}"
|
||||
Name: "{autodesktop}\\{{DISPLAY_NAME}}"; Filename: "{app}\\{{EXECUTABLE_NAME}}"; Tasks: desktopicon
|
||||
Name: "{userstartup}\\{{DISPLAY_NAME}}"; Filename: "{app}\\{{EXECUTABLE_NAME}}"; WorkingDir: "{app}"; Tasks: launchAtStartup
|
||||
|
||||
[Run]
|
||||
Filename: "{app}\\{{EXECUTABLE_NAME}}"; Description: "{cm:LaunchProgram,{{DISPLAY_NAME}}}"; Flags: runascurrentuser nowait postinstall skipifsilent
|
||||
@@ -1,8 +1,9 @@
|
||||
script_template: inno_setup.iss
|
||||
# AppId 的值唯一标识此应用。
|
||||
# 不要在其他应用的安装程序中使用相同的 AppId 值。
|
||||
app_id: 5ef970f9-2b9e-4155-b7d6-a9d4dbd6b226
|
||||
# publisher: LeanFlutter
|
||||
# publisher_url: https://github.com/fastforgedev/fastforge
|
||||
publisher: dom
|
||||
publisher_url: https://github.com/bggRGjQaUbCoE/PiliPlus
|
||||
display_name: PiliPlus
|
||||
# create_desktop_icon: true
|
||||
# See: https://jrsoftware.org/ishelp/index.php?topic=setup_defaultdirname
|
||||
@@ -11,4 +12,5 @@ display_name: PiliPlus
|
||||
setup_icon_file: windows\runner\resources\app_icon.ico
|
||||
locales:
|
||||
- en
|
||||
- zh
|
||||
- zh
|
||||
privileges_required: admin
|
||||
|
||||
Reference in New Issue
Block a user