Commit graph

158 commits

Author SHA1 Message Date
NBA2K1
34c97cf7ec Add graceful handling for database init failures
- Wrap `storage.initDB` in try/catch
- Log initialization errors with stack trace
- Show a minimal `_StartupErrorApp` when startup fails
- Skip post‑launch initialization if DB init did not succeed
- Introduce simple error UI with selectable error text
2026-05-11 19:45:27 +02:00
Moustapha Kodjo Amadou
b507f17846
Merge pull request #719 from NBA2K1/main
Make Code More Readable
2026-05-11 08:38:24 +01:00
Mehakdeep Singh
7b3916a221 perf(images): cap the decoded image cache by platform
Refs #609 (high RAM with stutters).

Flutter's `imageCache.maximumSizeBytes` defaults to 100 MB. With a large
manga library and full-resolution covers (a typical 720x1080 cover is
about 3 MB decoded), scrolling fills that cap quickly and the engine
starts evicting and re-decoding aggressively — felt as stutters and
elevated heap on memory-constrained devices.

Set the cap explicitly, sized for the platform: 64 MB on mobile, 256 MB
on desktop. Mobile gets a tight ceiling so the OS does not kill the app
on heap pressure; desktop keeps a generous budget so users with very
large libraries still scroll smoothly.

This is a one-line ceiling, not a fix for the underlying decode-at-
source-resolution behaviour — that is being tracked separately and
will further reduce per-image cache pressure.

The encoded-bytes LRU cache in `CustomExtendedNetworkImageProvider`
(`_memoryCache`, 50 MB) is independent of `PaintingBinding.imageCache`
and is unaffected by this change. So is the disk cache from
`extended_image_library`. Only the in-memory cache of decoded
`ui.Image` objects is bounded here.

Verified:
- `flutter analyze` clean
- `flutter build macos --release` succeeds
- Tested on macOS — Activity Monitor shows the desktop budget is
  comfortably above what the existing UI normally needs; mobile budget
  is consistent with what the system already imposes via OOM kills.
2026-05-09 23:30:59 -07:00
NBA2K1
aeff8be3b3 refactor the widget‑wrapping logic to be cleaner
- Replace child mutation with two clearly named variables
  - This is a pure refactor:
    - base = the result of wrapping with BotToastInit
    - withBackHandler = optionally wrapped with _MouseBackButtonHandler
  - No logic changes - just clearer variable names and no reassignment.

Improves readability and maintainability.
2026-05-09 18:23:37 +02:00
NBA2K1
dd6ff2580a Use Platform Helper Everywhere Possible 2026-04-26 19:42:13 +02:00
NBA2K1
b87eecf6b6 Only init discordRPC when not in debugMode 2026-04-21 21:42:07 +02:00
Moustapha Kodjo Amadou
2ef2a33b0d fix: improve app lock screen handling and mouse back button support 2026-04-15 14:04:13 +01:00
NBA2K1
8a39977c88 Workaround for libepoxy error when closing app
on Linux. Caused by media-kit
2026-04-06 17:51:08 +02:00
NBA2K1
bc9d8f80fc Fix Exception on startup
════════ Exception caught by Flutter framework ═════════════════════════════════
The following assertion was thrown during runApp:
Zone mismatch.
The Flutter bindings were initialized in a different zone than is now being used. This will likely cause confusion and bugs as any zone-specific configuration will inconsistently use the configuration of the original binding initialization zone or this zone based on hard-to-predict factors such as which zone was active when a particular callback was set.
It is important to use the same zone when calling `ensureInitialized` on the binding as when calling `runApp` later.
To make this warning fatal, set BindingBase.debugZoneErrorsAreFatal to true before the bindings are initialized (i.e. as the first statement in `void main() { }`).

When the exception was thrown, this was the stack:
#0      BindingBase.debugCheckZone.<anonymous closure> (package:flutter/src/foundation/binding.dart:519:31)
binding.dart:519
#1      BindingBase.debugCheckZone (package:flutter/src/foundation/binding.dart:525:6)
binding.dart:525
#2      _runWidget (package:flutter/src/widgets/binding.dart:1680:18)
binding.dart:1680
#3      runApp (package:flutter/src/widgets/binding.dart:1616:3)
binding.dart:1616
#4      main.<anonymous closure> (package:mangayomi/main.dart:108:7)
main.dart:108
<asynchronous suspension>
════════════════════════════════════════════════════════════════════════════════
2026-04-06 17:47:01 +02:00
NBA2K1
3fbcad25bd Fix Exception
Exception has occurred.
_AssertionError ('package:bot_toast/src/bot_toast_init.dart': Failed assertion: line 9 pos 10: '_key.currentState != null': is not true.)
2026-04-04 17:03:21 +02:00
Moustapha Kodjo Amadou
566da0ae06 feat: implement multiple bug fixes and feature requests\n\n- #339: Remember window size/position on desktop (WindowGeometry utility)\n- #256: Add S key shortcut to skip intro in desktop anime player\n- #372: Auto-delete downloaded chapters after reading (new setting + toggle)\n- #402: Fix manhwa reader scroll jumps by caching image dimensions for placeholders\n- #608: Fix 'Fit width' scale type cropping pages in paged reader mode\n- #572: Add mouse back button navigation support on desktop" 2026-03-17 14:31:21 +01:00
Moustapha Kodjo Amadou
f729380223 feat: Implement app lock feature with biometric authentication
- Added AppLockScreen for biometric authentication to unlock the app.
- Introduced security settings screen to enable/disable app lock.
- Integrated local_auth package for biometric authentication support.
- Created security state providers to manage app lock state.
- Updated chapter list tile widget to support dismiss actions for bookmarking and marking chapters as read.
- Enhanced CBZ conversion process to include ComicInfo.xml metadata.
- Added conditional UI elements based on platform capabilities.
- Added Completed & Tracked filter in library
2026-03-04 11:56:49 +01:00
Moustapha Kodjo Amadou
a5fd40fdfb Add global error handling in main function 2026-03-02 11:55:19 +01:00
Moustapha Kodjo Amadou
83b7d31e0a Increase isolate pool size to enhance concurrent download capabilities 2026-01-09 11:48:23 +01:00
Moustapha Kodjo Amadou
b9f9a8398f Refactor download management with shared isolate pool and optimize concurrent downloads 2026-01-08 13:01:15 +01:00
Moustapha Kodjo Amadou
1b708d6884 feat(server): integrate MExtensionServer 2025-12-08 15:14:12 +01:00
NBA2K1
33152fc035 Fix ProviderDisposedException
[ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: Cannot use the Ref of totalChapterCacheSizeStateProvider after it has been disposed. This typically happens if:
- A provider rebuilt, but the previous "build" was still pending and is still performing operations.
  You should therefore either use `ref.onDispose` to cancel pending work, or
  check `ref.mounted` after async gaps or anything that could invalidate the provider.
- You tried to use Ref inside `onDispose` or other life-cycles.
  This is not supported, as the provider is already being disposed.

#0      Ref._throwIfInvalidUsage (package:riverpod/src/core/ref.dart:220:7)
ref.dart:220
#1      AnyNotifier.state= (package:riverpod/src/core/provider/notifier_provider.dart:91:9)
notifier_provider.dart:91
#2      TotalChapterCacheSizeState.build.<anonymous closure> (package:mangayomi/modules/more/data_and_storage/providers/storage_usage.dart:17:42)
storage_usage.dart:17
#3      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:948:45)
future_impl.dart:948
#4      Future._propagateToListeners (dart:async/future_impl.dart:977:13)
future_impl.dart:977
#5      Future._completeWithValue (dart:async/future_impl.dart:720:5)
future_impl.dart:720
<asynchronous suspension>
2025-11-29 01:31:22 +01:00
NBA2K1
5fdbf530cb stopCfResolutionWebviewServer()
Stop the cf server on app exit
2025-11-29 00:18:13 +01:00
NBA2K1
5c34dcab9a Start Cloudflare resolution after app starts
- Defer the Cloudflare resolution webserver until after runApp().

- await said function
2025-11-28 23:59:37 +01:00
Moustapha Kodjo Amadou
b6eb5f2f3f refactor: remove old layout migration code 2025-11-25 16:51:49 +01:00
Moustapha Kodjo Amadou
f06df9b3b1 feat: implement CF resolution server 2025-11-25 14:53:22 +01:00
Moustapha Kodjo Amadou
a8f78d41fb fix: update directory handling for macOS 2025-11-12 11:45:27 +01:00
Moustapha Kodjo Amadou
c649525145 Fix directory deletion logic to check existence before deletion 2025-11-08 21:54:15 +01:00
NBA2K1
1b64f2650e Merge remote-tracking branch 'upstream/main' into Correct-directory 2025-11-08 14:59:23 +01:00
Moustapha Kodjo Amadou
ea50cc91ca Add IsolateService for improved asynchronous operations and refactor service calls to utilize it 2025-11-07 16:48:42 +01:00
Moustapha Kodjo Amadou
6e94632417 Add image cropping functionality with isolate support and optimize crop border processing 2025-11-06 16:47:32 +01:00
NBA2K1
a307e9d049 Merge remote-tracking branch 'upstream/main' into Correct-directory 2025-10-29 18:30:50 +01:00
Moustapha Kodjo Amadou
b475721841 downgrade package_info_plus version to 8.0.0 and adjust retry logic in ProviderScope 2025-10-29 14:29:27 +01:00
Moustapha Kodjo Amadou
430e81e021 Refactor and update dependencies for Isar and Riverpod 2025-10-29 13:08:42 +01:00
Schnitzel5
f71a2fcc4c fix 2025-09-02 18:30:08 +02:00
Schnitzel5
477beeb360 + 2025-09-02 00:05:28 +02:00
NBA2K1
e6b6fd6a92 Merge remote-tracking branch 'upstream/main' into Correct-directory 2025-08-30 00:33:31 +02:00
Schnitzel5
4d89cfe32b fixed Trakt refresh token
- now refreshes expired tokens at startup
- prevents accidental logouts for users who has the tracking screen as default navigation
2025-08-27 18:21:22 +02:00
Schnitzel5
f6c2a24af2 added app logger 2025-08-26 22:07:49 +02:00
Schnitzel5
604e1b18d3 Merge branch 'temp/mihon' into feature/mihon 2025-08-23 03:53:17 +02:00
Schnitzel5
74c5eab379 enhanced repo manager
- added custom DNS setting
2025-08-23 03:33:48 +02:00
NBA2K1
fa86025ed0 migrate function for iOS 2025-08-08 17:46:50 +02:00
Schnitzel5
2eca6576a2 added deep link for custom buttons 2025-08-05 01:48:19 +02:00
Schnitzel5
c58646244e fix mpv unzip 2025-08-03 23:42:17 +02:00
Schnitzel5
4682ab3577 added custom buttons 2025-07-28 23:42:55 +02:00
Schnitzel5
6be2775fee added filler, thumbnail and description info to chapter list 2025-07-25 20:08:51 +02:00
Schnitzel5
38728ce0cb Merge branch 'temp/mpv-anime4k' into feature/mpv-anime4k 2025-07-24 22:31:58 +02:00
Schnitzel5
1450641f16 added mpv config for Anime4K 2025-07-24 22:25:14 +02:00
NBA2K1
0b83be6d7a Revert Android changes 2025-07-24 16:50:55 +02:00
NBA2K1
7245552ade Merge branch 'main' into Correct-directory 2025-07-24 13:01:42 +02:00
NBA2K1
83934d7f35 Fix iOS and Android
The initialization of discordRPC on iOS and Android was leading to a grey screen (UnimplementedError), preventing the app to paint the Flutter UI.
The flutter_discord_rpc is only available on macOS, Linux and Windows.
2025-07-24 01:45:58 +02:00
NBA2K1
976010f6f0 Merge remote-tracking branch 'upstream/main' into Correct-directory 2025-07-21 14:55:17 +02:00
Schnitzel5
d139042241 added discord rpc 2025-07-18 01:02:59 +02:00
NBA2K1
5a18d5f0f0 storage permission
potentially fixes #430
2025-07-16 18:21:04 +02:00
NBA2K1
ba49e4e75d Put the hive database into the app's folder
On Windows and Linux the files were created in the ~/Documents folder.
Now they will be created in ~/Documents/Mangayomi/databases instead
2025-07-12 05:28:25 +02:00