mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-04-21 16:01:58 +00:00
Merge pull request #381 from Schnitzel5/adjust/sync-text
optimized sync and bug fixes
This commit is contained in:
commit
8b25382b82
15 changed files with 200 additions and 114 deletions
205
.github/workflows/release.yml
vendored
205
.github/workflows/release.yml
vendored
|
|
@ -10,7 +10,6 @@ concurrency:
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
build-and-release-android-apks:
|
build-and-release-android-apks:
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
|
@ -22,11 +21,11 @@ jobs:
|
||||||
- name: setup flutter
|
- name: setup flutter
|
||||||
uses: subosito/flutter-action@v2
|
uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: 'stable'
|
channel: "stable"
|
||||||
|
|
||||||
- name: Setup Rust toolchain
|
- name: Setup Rust toolchain
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
- name: Setup Java toolchain (Only Android target)
|
- name: Setup Java toolchain (Only Android target)
|
||||||
uses: actions/setup-java@v4
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
|
|
@ -36,7 +35,7 @@ jobs:
|
||||||
- name: Setup cmake
|
- name: Setup cmake
|
||||||
uses: jwlawson/actions-setup-cmake@v2
|
uses: jwlawson/actions-setup-cmake@v2
|
||||||
with:
|
with:
|
||||||
cmake-version: '3.18.1'
|
cmake-version: "3.18.1"
|
||||||
|
|
||||||
- name: Setup ninja
|
- name: Setup ninja
|
||||||
uses: seanmiddleditch/gha-setup-ninja@master
|
uses: seanmiddleditch/gha-setup-ninja@master
|
||||||
|
|
@ -84,14 +83,13 @@ jobs:
|
||||||
- name: setup flutter
|
- name: setup flutter
|
||||||
uses: subosito/flutter-action@v2
|
uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: 'stable'
|
channel: "stable"
|
||||||
|
|
||||||
- name: Setup Rust toolchain
|
- name: Setup Rust toolchain
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
- name: Install the CLI tool
|
- name: Install the CLI tool
|
||||||
run: cargo install 'flutter_rust_bridge_codegen'
|
run: cargo install 'flutter_rust_bridge_codegen'
|
||||||
|
|
||||||
|
|
||||||
- name: flutter pub get
|
- name: flutter pub get
|
||||||
run: flutter pub get
|
run: flutter pub get
|
||||||
|
|
@ -130,14 +128,13 @@ jobs:
|
||||||
- name: setup flutter
|
- name: setup flutter
|
||||||
uses: subosito/flutter-action@v2
|
uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: 'stable'
|
channel: "stable"
|
||||||
|
|
||||||
- name: Setup Rust toolchain
|
- name: Setup Rust toolchain
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
- name: Install the CLI tool
|
- name: Install the CLI tool
|
||||||
run: cargo install 'flutter_rust_bridge_codegen'
|
run: cargo install 'flutter_rust_bridge_codegen'
|
||||||
|
|
||||||
|
|
||||||
- name: flutter pub get
|
- name: flutter pub get
|
||||||
run: flutter pub get
|
run: flutter pub get
|
||||||
|
|
@ -174,7 +171,7 @@ jobs:
|
||||||
- name: setup flutter
|
- name: setup flutter
|
||||||
uses: subosito/flutter-action@v2
|
uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: 'stable'
|
channel: "stable"
|
||||||
|
|
||||||
- name: Setup Rust toolchain
|
- name: Setup Rust toolchain
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
@ -185,29 +182,40 @@ jobs:
|
||||||
- name: flutter pub get
|
- name: flutter pub get
|
||||||
run: flutter pub get
|
run: flutter pub get
|
||||||
|
|
||||||
- name: Enable dart_distributor
|
- name: Enable inno_bundle
|
||||||
run: dart pub global activate flutter_distributor
|
run: dart pub global activate inno_bundle
|
||||||
|
|
||||||
- name: Update PATH
|
- name: Update PATH
|
||||||
run: echo 'export PATH="$PATH:$HOME/.pub-cache/bin"' >> ~/.bashrc
|
run: echo 'export PATH="$PATH:$HOME/.pub-cache/bin"' >> ~/.bashrc
|
||||||
|
|
||||||
- name: build windows
|
- name: build windows exe
|
||||||
run: |
|
run: |
|
||||||
flutter_distributor package --platform windows --targets zip --artifact-name 'Mangayomi-${{ github.ref_name }}-windows.zip'
|
dart run inno_bundle:build --release
|
||||||
|
|
||||||
|
- name: build windows zip
|
||||||
|
run: |
|
||||||
|
cd build/windows/x64/installer/Release
|
||||||
|
Rename-Item -Path "*-Installer.exe" -NewName "Mangayomi-${{ github.ref_name }}-windows.exe"
|
||||||
|
cd ../../runner/Release
|
||||||
|
Compress-Archive -Path * -DestinationPath Mangayomi-Windows.zip
|
||||||
|
Rename-Item -Path "Mangayomi-*.zip" -NewName "Mangayomi-${{ github.ref_name }}-windows.zip"
|
||||||
|
|
||||||
- name: upload artifact windows zip
|
- name: upload artifact windows zip
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: Mangayomi-${{ github.ref_name }}-windows-zip
|
name: Mangayomi-${{ github.ref_name }}-windows-zip
|
||||||
path: dist/**/Mangayomi-*.zip
|
path: |
|
||||||
|
build/windows/x64/installer/Release/Mangayomi-*.exe
|
||||||
|
build/windows/x64/runner/Release/Mangayomi-*.zip
|
||||||
|
|
||||||
- name: release package windows zip
|
- name: release package windows zip
|
||||||
uses: ncipollo/release-action@v1
|
uses: ncipollo/release-action@v1
|
||||||
with:
|
with:
|
||||||
artifacts: dist/**/Mangayomi-*.zip
|
artifacts: |
|
||||||
|
build/windows/x64/installer/Release/Mangayomi-*.exe
|
||||||
|
build/windows/x64/runner/Release/Mangayomi-*.zip
|
||||||
allowUpdates: true
|
allowUpdates: true
|
||||||
|
|
||||||
|
|
||||||
build-and-release-linux-zip:
|
build-and-release-linux-zip:
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
|
@ -219,12 +227,15 @@ jobs:
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install webkit2gtk-4.1 clang cmake ninja-build pkg-config libgtk-3-dev mpv libmpv-dev dpkg-dev
|
sudo apt-get install webkit2gtk-4.1 clang cmake ninja-build pkg-config libgtk-3-dev mpv libmpv-dev dpkg-dev libblkid-dev liblzma-dev fuse rpm
|
||||||
|
wget -O appimagetool "https://github.com/AppImage/AppImageKit/releases/latest/download/appimagetool-x86_64.AppImage"
|
||||||
|
chmod +x appimagetool
|
||||||
|
sudo mv appimagetool /usr/local/bin/
|
||||||
|
|
||||||
- name: setup flutter
|
- name: setup flutter
|
||||||
uses: subosito/flutter-action@v2
|
uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: 'stable'
|
channel: "stable"
|
||||||
|
|
||||||
- name: Setup Rust toolchain
|
- name: Setup Rust toolchain
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
@ -236,23 +247,109 @@ jobs:
|
||||||
run: flutter pub get
|
run: flutter pub get
|
||||||
|
|
||||||
- name: build linux
|
- name: build linux
|
||||||
run: flutter build linux
|
run: flutter build linux --release
|
||||||
- name: Zip
|
|
||||||
|
- name: Zip
|
||||||
uses: thedoctor0/zip-release@master
|
uses: thedoctor0/zip-release@master
|
||||||
with:
|
with:
|
||||||
type: "zip"
|
type: "zip"
|
||||||
filename: Mangayomi-${{ github.ref_name }}-linux.zip
|
filename: Mangayomi-${{ github.ref_name }}-linux.zip
|
||||||
directory: build/linux/x64/release/bundle
|
directory: build/linux/x64/release/bundle
|
||||||
|
|
||||||
|
- name: Create AppImage
|
||||||
|
run: |
|
||||||
|
# Create fresh AppDir structure
|
||||||
|
rm -rf AppDir
|
||||||
|
mkdir -p AppDir/usr/bin
|
||||||
|
mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps
|
||||||
|
# Copy built files
|
||||||
|
cp -r build/linux/x64/release/bundle/* AppDir/usr/bin/
|
||||||
|
cp assets/app_icons/icon-red.png AppDir/usr/share/icons/hicolor/256x256/apps/mangayomi.png
|
||||||
|
cp assets/app_icons/icon-red.png AppDir/mangayomi.png
|
||||||
|
# Create desktop file in AppDir root
|
||||||
|
cat <<EOF > AppDir/mangayomi.desktop
|
||||||
|
[Desktop Entry]
|
||||||
|
Name=mangayomi
|
||||||
|
Exec=usr/bin/mangayomi
|
||||||
|
Icon=mangayomi
|
||||||
|
Type=Application
|
||||||
|
Categories=Utility;
|
||||||
|
EOF
|
||||||
|
# Create AppRun file
|
||||||
|
cat <<EOF > AppDir/AppRun
|
||||||
|
#!/bin/sh
|
||||||
|
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/mangayomi" "\$@"
|
||||||
|
EOF
|
||||||
|
chmod +x AppDir/AppRun
|
||||||
|
# Make AppImage
|
||||||
|
/usr/local/bin/appimagetool AppDir
|
||||||
|
mv $(find . -type f -name "*.AppImage") build/linux/x64/release/Mangayomi-${{ github.ref_name }}-linux.AppImage
|
||||||
|
|
||||||
|
- name: Create RPM Package
|
||||||
|
run: |
|
||||||
|
mkdir -p rpm_build/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
|
||||||
|
cp -r build/linux/x64/release/bundle rpm_build/SOURCES/mangayomi-1.0.0
|
||||||
|
tar czf rpm_build/SOURCES/mangayomi-1.0.0.tar.gz -C rpm_build/SOURCES mangayomi-1.0.0
|
||||||
|
mkdir -p rpm_build/SOURCES/usr/share/icons/hicolor/256x256/apps
|
||||||
|
cp assets/app_icons/icon-red.png rpm_build/SOURCES/usr/share/icons/hicolor/256x256/apps/mangayomi.png
|
||||||
|
# RPM Spec File
|
||||||
|
cat <<EOF > rpm_build/SPECS/mangayomi.spec
|
||||||
|
Name: mangayomi
|
||||||
|
Version: 1.0.0
|
||||||
|
Release: 1%{?dist}
|
||||||
|
Summary: Mangayomi is an open-source Flutter app for reading manga, novels, and watching animes across multiple platforms
|
||||||
|
License: MIT
|
||||||
|
Source0: %{name}-%{version}.tar.gz
|
||||||
|
BuildArch: x86_64
|
||||||
|
|
||||||
|
%description
|
||||||
|
Mangayomi is an open-source Flutter app for reading manga, novels, and watching animes across multiple platforms.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup -q
|
||||||
|
|
||||||
|
%install
|
||||||
|
mkdir -p %{buildroot}/usr/bin
|
||||||
|
mkdir -p %{buildroot}/usr/share/applications
|
||||||
|
mkdir -p %{buildroot}/usr/share/icons/hicolor/256x256/apps
|
||||||
|
cp -r * %{buildroot}/usr/bin/
|
||||||
|
cp -r %{_sourcedir}/usr/share/* %{buildroot}/usr/share/
|
||||||
|
cat <<EOL > %{buildroot}/usr/share/applications/mangayomi.desktop
|
||||||
|
[Desktop Entry]
|
||||||
|
Name=mangayomi
|
||||||
|
Exec=/usr/bin/mangayomi
|
||||||
|
Icon=mangayomi
|
||||||
|
Type=Application
|
||||||
|
Categories=Utility;
|
||||||
|
EOL
|
||||||
|
%files
|
||||||
|
/usr/bin/*
|
||||||
|
/usr/share/applications/mangayomi.desktop
|
||||||
|
/usr/share/icons/hicolor/256x256/apps/mangayomi.png
|
||||||
|
EOF
|
||||||
|
|
||||||
|
rpmbuild --define "_topdir $(pwd)/rpm_build" -ba rpm_build/SPECS/mangayomi.spec
|
||||||
|
mv rpm_build/RPMS/x86_64/*.rpm build/linux/x64/release/Mangayomi-${{ github.ref_name }}-linux.rpm
|
||||||
|
|
||||||
- name: upload artifact linux zip
|
- name: upload artifact linux zip
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: Mangayomi-${{ github.ref_name }}-limux-zip
|
name: Mangayomi-${{ github.ref_name }}-limux-zip
|
||||||
path: build/linux/x64/release/bundle/Mangayomi-*.zip
|
path: |
|
||||||
|
build/linux/x64/release/bundle/Mangayomi-*.zip
|
||||||
|
build/linux/x64/release/Mangayomi-*.AppImage
|
||||||
|
build/linux/x64/release/Mangayomi-*.rpm
|
||||||
- name: release packages linux zip
|
- name: release packages linux zip
|
||||||
uses: ncipollo/release-action@v1
|
uses: ncipollo/release-action@v1
|
||||||
with:
|
with:
|
||||||
artifacts: build/linux/x64/release/bundle/Mangayomi-*.zip
|
artifacts: |
|
||||||
|
build/linux/x64/release/bundle/Mangayomi-*.zip
|
||||||
|
build/linux/x64/release/Mangayomi-*.AppImage
|
||||||
|
build/linux/x64/release/Mangayomi-*.rpm
|
||||||
allowUpdates: true
|
allowUpdates: true
|
||||||
|
|
||||||
build-and-release-linux-deb:
|
build-and-release-linux-deb:
|
||||||
|
|
@ -271,14 +368,14 @@ jobs:
|
||||||
- name: setup flutter
|
- name: setup flutter
|
||||||
uses: subosito/flutter-action@v2
|
uses: subosito/flutter-action@v2
|
||||||
with:
|
with:
|
||||||
channel: 'stable'
|
channel: "stable"
|
||||||
|
|
||||||
- name: Setup Rust toolchain
|
- name: Setup Rust toolchain
|
||||||
uses: dtolnay/rust-toolchain@stable
|
uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
- name: Install the CLI tool
|
- name: Install the CLI tool
|
||||||
run: cargo install 'flutter_rust_bridge_codegen'
|
run: cargo install 'flutter_rust_bridge_codegen'
|
||||||
|
|
||||||
- name: flutter pub get
|
- name: flutter pub get
|
||||||
run: flutter pub get
|
run: flutter pub get
|
||||||
|
|
||||||
|
|
@ -305,59 +402,3 @@ jobs:
|
||||||
with:
|
with:
|
||||||
artifacts: dist/Mangayomi-*.deb
|
artifacts: dist/Mangayomi-*.deb
|
||||||
allowUpdates: true
|
allowUpdates: true
|
||||||
|
|
||||||
# build-and-release-linux-appimage:
|
|
||||||
# permissions:
|
|
||||||
# contents: write
|
|
||||||
# runs-on: ubuntu-latest
|
|
||||||
# steps:
|
|
||||||
# - name: checkout branch
|
|
||||||
# uses: actions/checkout@v4
|
|
||||||
|
|
||||||
# - name: Install dependencies
|
|
||||||
# run: |
|
|
||||||
# sudo apt-get update
|
|
||||||
# sudo apt-get install webkit2gtk-4.1 clang cmake ninja-build pkg-config libgtk-3-dev mpv libmpv-dev dpkg-dev libfuse2 locate
|
|
||||||
# wget -O appimagetool "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage"
|
|
||||||
# chmod +x appimagetool
|
|
||||||
# sudo mv appimagetool /usr/local/bin/
|
|
||||||
|
|
||||||
# - name: setup flutter
|
|
||||||
# uses: subosito/flutter-action@v2
|
|
||||||
# with:
|
|
||||||
# channel: 'stable'
|
|
||||||
|
|
||||||
# - name: Setup Rust toolchain
|
|
||||||
# uses: dtolnay/rust-toolchain@stable
|
|
||||||
|
|
||||||
# - name: Install the CLI tool
|
|
||||||
# run: cargo install 'flutter_rust_bridge_codegen'
|
|
||||||
|
|
||||||
# - name: flutter pub get
|
|
||||||
# run: flutter pub get
|
|
||||||
|
|
||||||
# - name: Enable dart_distributor
|
|
||||||
# run: dart pub global activate flutter_distributor
|
|
||||||
|
|
||||||
# - name: Update PATH
|
|
||||||
# run: echo 'export PATH="$PATH:$HOME/.pub-cache/bin"' >> ~/.bashrc
|
|
||||||
|
|
||||||
# - name: Build AppImage package
|
|
||||||
# run: flutter_distributor package --platform linux --targets appimage
|
|
||||||
|
|
||||||
# - name: Rebuild AppImage package
|
|
||||||
# run: flutter_distributor package --platform linux --targets appimage
|
|
||||||
|
|
||||||
# - name: Move AppImage file
|
|
||||||
# run: mv $(find dist -type f -name "mangayomi*.AppImage") dist/Mangayomi-${{ github.ref_name }}-linux.AppImage
|
|
||||||
|
|
||||||
# - name: upload artifact linux AppImage
|
|
||||||
# uses: actions/upload-artifact@v4
|
|
||||||
# with:
|
|
||||||
# path: dist/Mangayomi-*.AppImage
|
|
||||||
|
|
||||||
# - name: Release package AppImage
|
|
||||||
# uses: ncipollo/release-action@v1
|
|
||||||
# with:
|
|
||||||
# artifacts: dist/Mangayomi-*.AppImage
|
|
||||||
# allowUpdates: true
|
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,6 @@
|
||||||
<category android:name="android.intent.category.BROWSABLE" />
|
<category android:name="android.intent.category.BROWSABLE" />
|
||||||
<data android:scheme="mangayomi" />
|
<data android:scheme="mangayomi" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
<meta-data android:name="flutter_deeplinking_enabled" android:value="false" />
|
|
||||||
</activity>
|
</activity>
|
||||||
<!-- Don't delete the meta-data below.
|
<!-- Don't delete the meta-data below.
|
||||||
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||||
|
|
@ -55,5 +54,6 @@
|
||||||
<meta-data
|
<meta-data
|
||||||
android:name="io.flutter.embedding.android.EnableImpeller"
|
android:name="io.flutter.embedding.android.EnableImpeller"
|
||||||
android:value="false" />
|
android:value="false" />
|
||||||
|
<meta-data android:name="flutter_deeplinking_enabled" android:value="false" />
|
||||||
</application>
|
</application>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|
|
||||||
|
|
@ -64,5 +64,16 @@
|
||||||
<true/>
|
<true/>
|
||||||
<key>FlutterDeepLinkingEnabled</key>
|
<key>FlutterDeepLinkingEnabled</key>
|
||||||
<false/>
|
<false/>
|
||||||
|
<key>CFBundleURLTypes</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleURLName</key>
|
||||||
|
<string>mangayomi</string>
|
||||||
|
<key>CFBundleURLSchemes</key>
|
||||||
|
<array>
|
||||||
|
<string>mangayomi</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
|
|
||||||
|
|
@ -520,21 +520,21 @@ class Settings {
|
||||||
mangaExtensionsRepo = json['mangaExtensionsRepo'] is String
|
mangaExtensionsRepo = json['mangaExtensionsRepo'] is String
|
||||||
? [Repo(jsonUrl: json['mangaExtensionsRepo'])]
|
? [Repo(jsonUrl: json['mangaExtensionsRepo'])]
|
||||||
: (json['mangaExtensionsRepo'] as List)
|
: (json['mangaExtensionsRepo'] as List)
|
||||||
.map((e) => Repo.fromJson(json))
|
.map((e) => Repo.fromJson(e))
|
||||||
.toList();
|
.toList();
|
||||||
}
|
}
|
||||||
if (json['animeExtensionsRepo'] != null) {
|
if (json['animeExtensionsRepo'] != null) {
|
||||||
animeExtensionsRepo = json['animeExtensionsRepo'] is String
|
animeExtensionsRepo = json['animeExtensionsRepo'] is String
|
||||||
? [Repo(jsonUrl: json['animeExtensionsRepo'])]
|
? [Repo(jsonUrl: json['animeExtensionsRepo'])]
|
||||||
: (json['animeExtensionsRepo'] as List)
|
: (json['animeExtensionsRepo'] as List)
|
||||||
.map((e) => Repo.fromJson(json))
|
.map((e) => Repo.fromJson(e))
|
||||||
.toList();
|
.toList();
|
||||||
}
|
}
|
||||||
if (json['novelExtensionsRepo'] != null) {
|
if (json['novelExtensionsRepo'] != null) {
|
||||||
novelExtensionsRepo = json['novelExtensionsRepo'] is String
|
novelExtensionsRepo = json['novelExtensionsRepo'] is String
|
||||||
? [Repo(jsonUrl: json['novelExtensionsRepo'])]
|
? [Repo(jsonUrl: json['novelExtensionsRepo'])]
|
||||||
: (json['novelExtensionsRepo'] as List)
|
: (json['novelExtensionsRepo'] as List)
|
||||||
.map((e) => Repo.fromJson(json))
|
.map((e) => Repo.fromJson(e))
|
||||||
.toList();
|
.toList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ class _MainScreenState extends ConsumerState<MainScreen> {
|
||||||
final l10n = l10nLocalizations(context)!;
|
final l10n = l10nLocalizations(context)!;
|
||||||
Timer.periodic(Duration(seconds: autoSyncFrequency), (timer) {
|
Timer.periodic(Duration(seconds: autoSyncFrequency), (timer) {
|
||||||
try {
|
try {
|
||||||
ref.read(syncServerProvider(syncId: 1).notifier).startSync(l10n);
|
ref.read(syncServerProvider(syncId: 1).notifier).startSync(l10n, true);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
botToast(
|
botToast(
|
||||||
"Failed to sync! Maybe the sync server is down. Restart the app to resume auto sync.");
|
"Failed to sync! Maybe the sync server is down. Restart the app to resume auto sync.");
|
||||||
|
|
|
||||||
|
|
@ -107,15 +107,20 @@ Future<dynamic> updateMangaDetail(Ref ref,
|
||||||
for (var i = 0; i < oldChapers.length; i++) {
|
for (var i = 0; i < oldChapers.length; i++) {
|
||||||
final oldChap = oldChapers[i];
|
final oldChap = oldChapers[i];
|
||||||
final newChap = chaps[i];
|
final newChap = chaps[i];
|
||||||
|
final hasChanged = oldChap.name != newChap.name ||
|
||||||
|
oldChap.url != newChap.url ||
|
||||||
|
oldChap.scanlator != newChap.scanlator;
|
||||||
oldChap.name = newChap.name;
|
oldChap.name = newChap.name;
|
||||||
oldChap.url = newChap.url;
|
oldChap.url = newChap.url;
|
||||||
oldChap.scanlator = newChap.scanlator;
|
oldChap.scanlator = newChap.scanlator;
|
||||||
isar.chapters.putSync(oldChap);
|
isar.chapters.putSync(oldChap);
|
||||||
oldChap.manga.saveSync();
|
oldChap.manga.saveSync();
|
||||||
ref.read(synchingProvider(syncId: 1).notifier).addChangedPart(
|
if (!hasChanged) {
|
||||||
ActionType.updateItem, manga.id, manga.toJson(), false);
|
ref.read(synchingProvider(syncId: 1).notifier).addChangedPart(
|
||||||
ref.read(synchingProvider(syncId: 1).notifier).addChangedPart(
|
ActionType.updateItem, manga.id, manga.toJson(), false);
|
||||||
ActionType.updateChapter, oldChap.id, oldChap.toJson(), false);
|
ref.read(synchingProvider(syncId: 1).notifier).addChangedPart(
|
||||||
|
ActionType.updateChapter, oldChap.id, oldChap.toJson(), false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ part of 'update_manga_detail_providers.dart';
|
||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
String _$updateMangaDetailHash() => r'ebd820d3e9d1900c464aebfbf711f43f6619e586';
|
String _$updateMangaDetailHash() => r'4aed7678d299321491de442c592968df22b62f48';
|
||||||
|
|
||||||
/// Copied from Dart SDK
|
/// Copied from Dart SDK
|
||||||
class _SystemHash {
|
class _SystemHash {
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ class _SourceRepositoriesState extends ConsumerState<SourceRepositories> {
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
width: 10,
|
width: 10,
|
||||||
),
|
),
|
||||||
Expanded(child: Text(repo.name ?? repo.jsonUrl!))
|
Expanded(child: Text(repo.name ?? repo.jsonUrl ?? "Invalid source - remove it"))
|
||||||
],
|
],
|
||||||
)),
|
)),
|
||||||
Row(
|
Row(
|
||||||
|
|
|
||||||
|
|
@ -226,7 +226,7 @@ class SyncScreen extends ConsumerWidget {
|
||||||
ref
|
ref
|
||||||
.read(syncServerProvider(syncId: 1)
|
.read(syncServerProvider(syncId: 1)
|
||||||
.notifier)
|
.notifier)
|
||||||
.startSync(l10n);
|
.startSync(l10n, false);
|
||||||
},
|
},
|
||||||
icon: Icon(
|
icon: Icon(
|
||||||
Icons.sync,
|
Icons.sync,
|
||||||
|
|
@ -325,7 +325,12 @@ class SyncScreen extends ConsumerWidget {
|
||||||
Text(l10n.sync_button_snapshot),
|
Text(l10n.sync_button_snapshot),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(width: 20),
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
const SizedBox(width: 30),
|
||||||
Column(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
IconButton(
|
IconButton(
|
||||||
|
|
@ -413,7 +418,7 @@ class SyncScreen extends ConsumerWidget {
|
||||||
Text(l10n.sync_button_upload),
|
Text(l10n.sync_button_upload),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(width: 20),
|
const SizedBox(width: 30),
|
||||||
Column(
|
Column(
|
||||||
children: [
|
children: [
|
||||||
IconButton(
|
IconButton(
|
||||||
|
|
@ -535,7 +540,8 @@ class SyncScreen extends ConsumerWidget {
|
||||||
changedParts.getChangedParts([
|
changedParts.getChangedParts([
|
||||||
ActionType.addHistory,
|
ActionType.addHistory,
|
||||||
ActionType.clearHistory,
|
ActionType.clearHistory,
|
||||||
ActionType.removeHistory
|
ActionType.removeHistory,
|
||||||
|
ActionType.updateHistory,
|
||||||
])),
|
])),
|
||||||
const SizedBox(height: 15),
|
const SizedBox(height: 15),
|
||||||
buildChangedItemWidget(
|
buildChangedItemWidget(
|
||||||
|
|
@ -547,6 +553,7 @@ class SyncScreen extends ConsumerWidget {
|
||||||
l10n.sync_pending_extension,
|
l10n.sync_pending_extension,
|
||||||
changedParts.getChangedParts([
|
changedParts.getChangedParts([
|
||||||
ActionType.addExtension,
|
ActionType.addExtension,
|
||||||
|
ActionType.clearExtension,
|
||||||
ActionType.removeExtension,
|
ActionType.removeExtension,
|
||||||
ActionType.updateExtension
|
ActionType.updateExtension
|
||||||
])),
|
])),
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,8 @@ GoRouter router(Ref ref) {
|
||||||
debugLogDiagnostics: kDebugMode,
|
debugLogDiagnostics: kDebugMode,
|
||||||
refreshListenable: router,
|
refreshListenable: router,
|
||||||
routes: router._routes,
|
routes: router._routes,
|
||||||
navigatorKey: navigatorKey);
|
navigatorKey: navigatorKey,
|
||||||
|
onException: (context, state, router) => router.go(initLocation),);
|
||||||
}
|
}
|
||||||
|
|
||||||
@riverpod
|
@riverpod
|
||||||
|
|
|
||||||
|
|
@ -158,11 +158,11 @@ Future<void> fetchSourcesList(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
checkIfSourceIsObsolete(sourceList, itemType, ref);
|
checkIfSourceIsObsolete(sourceList, repo!, itemType, ref);
|
||||||
}
|
}
|
||||||
|
|
||||||
void checkIfSourceIsObsolete(
|
void checkIfSourceIsObsolete(
|
||||||
List<Source> sourceList, ItemType itemType, Ref ref) {
|
List<Source> sourceList, Repo repo, ItemType itemType, Ref ref) {
|
||||||
for (var source in isar.sources
|
for (var source in isar.sources
|
||||||
.filter()
|
.filter()
|
||||||
.idIsNotNull()
|
.idIsNotNull()
|
||||||
|
|
@ -173,11 +173,15 @@ void checkIfSourceIsObsolete(
|
||||||
sourceList.where((e) => e.id != null).map((e) => e.id).toList();
|
sourceList.where((e) => e.id != null).map((e) => e.id).toList();
|
||||||
if (ids.isNotEmpty) {
|
if (ids.isNotEmpty) {
|
||||||
isar.writeTxnSync(() {
|
isar.writeTxnSync(() {
|
||||||
if (source.isObsolete != !ids.contains(source.id)) {
|
if (source.isObsolete !=
|
||||||
|
(!ids.contains(source.id) &&
|
||||||
|
source.repo?.jsonUrl == repo.jsonUrl)) {
|
||||||
ref.read(synchingProvider(syncId: 1).notifier).addChangedPart(
|
ref.read(synchingProvider(syncId: 1).notifier).addChangedPart(
|
||||||
ActionType.updateExtension, source.id, source.toJson(), false);
|
ActionType.updateExtension, source.id, source.toJson(), false);
|
||||||
}
|
}
|
||||||
isar.sources.putSync(source..isObsolete = !ids.contains(source.id));
|
isar.sources.putSync(source
|
||||||
|
..isObsolete = !ids.contains(source.id) &&
|
||||||
|
source.repo?.jsonUrl == repo.jsonUrl);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ class SyncServer extends _$SyncServer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> startSync(AppLocalizations l10n) async {
|
Future<void> startSync(AppLocalizations l10n, bool silent) async {
|
||||||
botToast(l10n.sync_checking, second: 2);
|
botToast(l10n.sync_checking, second: 2);
|
||||||
try {
|
try {
|
||||||
final changedParts = ref
|
final changedParts = ref
|
||||||
|
|
@ -92,7 +92,7 @@ class SyncServer extends _$SyncServer {
|
||||||
await downloadFromServer(l10n, true, false);
|
await downloadFromServer(l10n, true, false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
await forceCheck(l10n, true);
|
await forceCheck(l10n, silent);
|
||||||
}
|
}
|
||||||
|
|
||||||
final syncNotifier = ref.read(synchingProvider(syncId: syncId).notifier);
|
final syncNotifier = ref.read(synchingProvider(syncId: syncId).notifier);
|
||||||
|
|
@ -100,7 +100,6 @@ class SyncServer extends _$SyncServer {
|
||||||
syncNotifier.clearAllChangedParts(true);
|
syncNotifier.clearAllChangedParts(true);
|
||||||
|
|
||||||
ref.invalidate(synchingProvider(syncId: syncId));
|
ref.invalidate(synchingProvider(syncId: syncId));
|
||||||
botToast(l10n.sync_download_finished, second: 2);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
botToast(error.toString(), second: 5);
|
botToast(error.toString(), second: 5);
|
||||||
}
|
}
|
||||||
|
|
@ -129,7 +128,7 @@ class SyncServer extends _$SyncServer {
|
||||||
if (localHash != remoteHash) {
|
if (localHash != remoteHash) {
|
||||||
await downloadFromServer(l10n, silent, false);
|
await downloadFromServer(l10n, silent, false);
|
||||||
} else if (!silent) {
|
} else if (!silent) {
|
||||||
botToast("Sync up to date", second: 2);
|
botToast(l10n.sync_up_to_date, second: 2);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
botToast(error.toString(), second: 5);
|
botToast(error.toString(), second: 5);
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ part of 'sync_server.dart';
|
||||||
// RiverpodGenerator
|
// RiverpodGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
String _$syncServerHash() => r'd13b5d6eaded02a9256e64550e98983b17ab70f4';
|
String _$syncServerHash() => r'f973d04732090056e127d6d882146adfd192705d';
|
||||||
|
|
||||||
/// Copied from Dart SDK
|
/// Copied from Dart SDK
|
||||||
class _SystemHash {
|
class _SystemHash {
|
||||||
|
|
|
||||||
19
pubspec.lock
19
pubspec.lock
|
|
@ -674,11 +674,12 @@ packages:
|
||||||
flutter_web_auth_2:
|
flutter_web_auth_2:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: flutter_web_auth_2
|
path: flutter_web_auth_2
|
||||||
sha256: "4d3d2fd3d26bf1a26b3beafd4b4b899c0ffe10dc99af25abc58ffe24e991133c"
|
ref: "3.x-without-v1"
|
||||||
url: "https://pub.dev"
|
resolved-ref: "48682f19576001e50104a602d891343850adb67f"
|
||||||
source: hosted
|
url: "https://github.com/ThexXTURBOXx/flutter_web_auth_2.git"
|
||||||
version: "3.1.2"
|
source: git
|
||||||
|
version: "3.1.2-without-v1"
|
||||||
flutter_web_auth_2_platform_interface:
|
flutter_web_auth_2_platform_interface:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|
@ -900,6 +901,14 @@ packages:
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.1.0"
|
version: "1.1.0"
|
||||||
|
inno_bundle:
|
||||||
|
dependency: "direct dev"
|
||||||
|
description:
|
||||||
|
name: inno_bundle
|
||||||
|
sha256: e9d0ab41a82157da42ebd4206bda22ed04bf096a6e7d416c79d79201c388d563
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "0.8.0"
|
||||||
intl:
|
intl:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
|
|
|
||||||
13
pubspec.yaml
13
pubspec.yaml
|
|
@ -93,7 +93,7 @@ dependency_overrides:
|
||||||
url: https://github.com/media-kit/media-kit.git
|
url: https://github.com/media-kit/media-kit.git
|
||||||
path: libs/windows/media_kit_libs_windows_video
|
path: libs/windows/media_kit_libs_windows_video
|
||||||
ref: 652c49e02701bb6bb80953a6fdf650a5c8f002f9
|
ref: 652c49e02701bb6bb80953a6fdf650a5c8f002f9
|
||||||
media_kit:
|
media_kit:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/media-kit/media-kit.git
|
url: https://github.com/media-kit/media-kit.git
|
||||||
path: media_kit
|
path: media_kit
|
||||||
|
|
@ -101,7 +101,11 @@ dependency_overrides:
|
||||||
meta: ^1.15.0
|
meta: ^1.15.0
|
||||||
collection: ^1.19.0
|
collection: ^1.19.0
|
||||||
js: ^0.7.1
|
js: ^0.7.1
|
||||||
|
flutter_web_auth_2:
|
||||||
|
git:
|
||||||
|
url: https://github.com/ThexXTURBOXx/flutter_web_auth_2.git
|
||||||
|
ref: 3.x-without-v1
|
||||||
|
path: flutter_web_auth_2
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|
@ -112,6 +116,7 @@ dev_dependencies:
|
||||||
isar_generator: ^3.1.0+1
|
isar_generator: ^3.1.0+1
|
||||||
flutter_lints: ^5.0.0
|
flutter_lints: ^5.0.0
|
||||||
freezed: ^2.0.0
|
freezed: ^2.0.0
|
||||||
|
inno_bundle: ^0.8.0
|
||||||
|
|
||||||
flutter:
|
flutter:
|
||||||
uses-material-design: true
|
uses-material-design: true
|
||||||
|
|
@ -134,3 +139,7 @@ flutter_launcher_icons:
|
||||||
macos:
|
macos:
|
||||||
generate: true
|
generate: true
|
||||||
image_path: "assets/app_icons/icon-red.png"
|
image_path: "assets/app_icons/icon-red.png"
|
||||||
|
inno_bundle:
|
||||||
|
id: 984c49b9-1c39-58f2-b0bb-8d30a87279e2
|
||||||
|
publisher: Mangayomi
|
||||||
|
name: Mangayomi
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue