Commit graph

171 commits

Author SHA1 Message Date
Moustapha Kodjo Amadou
cc69c9f275 + 2026-02-23 15:29:44 +01:00
Moustapha Kodjo Amadou
eec96c6258
Merge pull request #644 from NBA2K1/main
Improve extension service lifecycle, isolate robustness, dedupe lists, and UI/lifecycle cleanups
2026-02-13 10:50:32 +01:00
Moustapha Kodjo Amadou
d5aecf66dc Fix #643 2026-01-26 17:28:25 +01:00
NBA2K1
8b1f7fc581 Add service disposal and lifecycle cleanup
This commit improves memory management, reduces redundant interpreter
instantiation, and standardizes service usage patterns.

- Add `dispose()` to `ExtensionService` interface and implement it across
  Dart, JS, LNReader, and Mihon services.
- Replace repeated interpreter creation in `DartExtensionService` with a
  persistent `_interpreter` instance initialized once in the constructor.
- Add disposal logic for JS DOM selector and Cheerio instances to prevent
  memory leaks.
- Introduce `withExtensionService()` helper to ensure services are always
  disposed after use.
- Update call sites across the codebase to use `withExtensionService()`
  or manual try/finally disposal.
- Improve isolate service message handling by extracting `responsePort`
  earlier.
- Ensure safer defaults (e.g., returning empty lists, const lists) when
  service calls fail.
2026-01-13 01:11:19 +01:00
NBA2K1
267f2d12df dedupe page and video lists using LinkedHashSet
- Replace list→set→list conversions with LinkedHashSet for stable ordering
- Ensure PageUrl uniqueness based on URL
- Ensure Video uniqueness based on url + originalUrl
- Add null‑safety checks when building PageUrl and Video objects
- Improve readability and reduce unnecessary allocations
2026-01-08 23:52:31 +01:00
NBA2K1
ffda1ce1dc add locale caching, and improve WebView cleanup
- Added _initializedLocales to prevent repeated locale initialization
- Improved evaluateJavascriptViaWebview with safer lifecycle handling (try/finally + null checks)
- Minor cleanup and consistency improvements across MBridge utilities
2026-01-08 23:43:40 +01:00
Moustapha Kodjo Amadou
7c4c8d8a20 + 2026-01-05 12:12:56 +01:00
NBA2K1
0f83899bac remove unnecessary calls
.trimLeft().trimRight() after trim() is unnecessary.
2025-12-17 21:34:45 +01:00
Moustapha Kodjo Amadou
76645d97c1 fix: improve error handling for Cloudflare bypass failures 2025-12-14 14:01:40 +01:00
Moustapha Kodjo Amadou
57fcb9e1c9 chore: update dependencies 2025-11-28 14:31:39 +01:00
Moustapha Kodjo Amadou
6a099415db refactor: simplify filter parsing logic & pass client cookie to mihon server 2025-11-24 16:59:21 +01:00
Moustapha Kodjo Amadou
f2fbaf5ec5 refactor 2025-11-20 15:17:31 +01:00
Moustapha Kodjo Amadou
29fe96151d fix: enable logger usage in isolate service 2025-11-12 17:02:06 +01:00
Moustapha Kodjo Amadou
430e062a06 Fix attribute handling in JsHtmlParser to assign empty string for attributes without values 2025-11-07 19:17:57 +01:00
Moustapha Kodjo Amadou
430e81e021 Refactor and update dependencies for Isar and Riverpod 2025-10-29 13:08:42 +01:00
Moustapha Kodjo Amadou
2ff20c35cc + 2025-10-22 10:51:25 +01:00
Moustapha Kodjo Amadou
1f27c129a5 Fix null handling in SourceNovel.fromJson for name and path fields 2025-10-13 13:25:29 +01:00
Moustapha Kodjo Amadou
73a61c9003 reverse chapters 2025-10-13 11:30:55 +01:00
Schnitzel5
5e05c4e9aa some refactoring 2025-10-11 21:59:46 +02:00
Schnitzel5
b8a7bbbbb4 + 2025-10-11 17:56:52 +02:00
Schnitzel5
5ef46ec13d adding support for LNReader plugins 2025-10-10 15:49:33 +02:00
Schnitzel5
3aaac9e102 enhanced calendar
- predicts from latest chapter instead of current time (if available)
2025-08-26 01:23:46 +02:00
Moustapha Kodjo Amadou
3a577a4c9e Add fixed versions packages of isar_generator and hive_generator to avoid the Analyzer plugin error 2025-08-25 13:21:37 +01:00
Schnitzel5
604e1b18d3 Merge branch 'temp/mihon' into feature/mihon 2025-08-23 03:53:17 +02:00
Schnitzel5
7eba7bdcf2 added filters
- fixed torrents not playing
2025-08-22 17:13:28 +02:00
Schnitzel5
03108ae701 added preferences 2025-08-22 00:13:24 +02:00
Schnitzel5
a1ada0e03e search fix 2025-08-21 02:05:34 +02:00
Schnitzel5
9395888c6a added support for Mihon extensions via ApkBridge 2025-08-20 21:06:26 +02:00
Schnitzel5
5f9efe957a adding support for Mihon extensions 2025-08-20 03:59:38 +02:00
Schnitzel5
08b3991f5f Merge branch 'temp/mpv' into enhance/mpv 2025-08-06 03:12:50 +02:00
Schnitzel5
1db55b8018 fixed android screen
- adjusted show_text
- fixed exception for android update screen
2025-08-06 03:05:41 +02:00
Moustapha Kodjo Amadou
01dc5dba45 Bump d4rt version 2025-08-05 15:50:57 +01:00
Schnitzel5
1450641f16 added mpv config for Anime4K 2025-07-24 22:25:14 +02:00
Moustapha Kodjo Amadou
084f241746 Register additional bridged classes for SortState and HeaderFilter in the interpreter 2025-07-09 13:20:45 +01:00
Moustapha Kodjo Amadou
21282efbaf Add nativeNames property to BaseRequest bridged class 2025-07-08 13:14:13 +01:00
Moustapha Kodjo Amadou
4d27a2c0e3 fix #468 2025-06-02 11:41:12 +01:00
Moustapha Kodjo Amadou
87fd4ef340 fix Undefined variable for client 2025-06-02 10:10:14 +01:00
NBA2K1
00c666fe3f Fix Exception when leaving Code Editor
When leaving the Code Editor of certain Extensions, this Exception would throw:
```
[ERROR:flutter/runtime/dart_vm_initializer.cc(40)] Unhandled Exception: Runtime Error: Undefined variable: source (Original error: Undefined property 'source' on Madara.)
#0      InterpreterVisitor.visitSimpleIdentifier (package:d4rt/src/interpreter_visitor.dart:393:7)
interpreter_visitor.dart:393
#1      SimpleIdentifierImpl.accept (package:analyzer/src/dart/ast/ast.dart:16123:50)
ast.dart:16123
#2      InterpreterVisitor.visitPostfixExpression (package:d4rt/src/interpreter_visitor.dart:3930:41)
interpreter_visitor.dart:3930
#3      PostfixExpressionImpl.accept (package:analyzer/src/dart/ast/ast.dart:14311:50)
ast.dart:14311
#4      InterpreterVisitor._evaluateArguments (package:d4rt/src/interpreter_visitor.dart:5569:23)
interpreter_visitor.dart:5569
#5      InterpreterVisitor.visitMethodInvocation (package:d4rt/src/interpreter_visitor.dart:2178:13)
interpreter_visitor.dart:2178
#6      MethodInvocationImpl.accept (package:analyzer/src/dart/ast/ast.dart:12246:50)
ast.dart:12246
#7      InterpretedClass.createAndInitializeInstance (package:d4rt/src/runtime_types.dart:232:53)
runtime_types.dart:232
#8      InterpretedClass.call (package:d4rt/src/runtime_types.dart:299:22)
runtime_types.dart:299
#9      InterpreterVisitor.visitMethodInvocation (package:d4rt/src/interpreter_visitor.dart:2161:28)
interpreter_visitor.dart:2161
#10     MethodInvocationImpl.accept (package:analyzer/src/dart/ast/ast.dart:12246:50)
ast.dart:12246
#11     InterpreterVisitor.visitVariableDeclarationList (package:d4rt/src/interpreter_visitor.dart:3026:42)
interpreter_visitor.dart:3026
#12     VariableDeclarationListImpl.accept (package:analyzer/src/dart/ast/ast.dart:18695:15)
ast.dart:18695
#13     InterpreterVisitor.visitVariableDeclarationStatement (package:d4rt/src/interpreter_visitor.dart:135:27)
interpreter_visitor.dart:135
#14     VariableDeclarationStatementImpl.accept (package:analyzer/src/dart/ast/ast.dart:18753:15)
ast.dart:18753
#15     InterpreterVisitor.executeBlock (package:d4rt/src/interpreter_visitor.dart:66:33)
interpreter_visitor.dart:66
#16     InterpretedFunction.call (package:d4rt/src/callable.dart:589:36)
callable.dart:589
#17     D4rt.execute (package:d4rt/src/d4rt_base.dart:220:43)
d4rt_base.dart:220
#18     DartExtensionService._executeLib (package:mangayomi/eval/dart/service.dart:24:17)
service.dart:24
#19     DartExtensionService.getSourcePreferences (package:mangayomi/eval/dart/service.dart:179:25)
service.dart:179
#20     getSourcePreference (package:mangayomi/services/get_source_preference.dart:6:38)
get_source_preference.dart:6
#21     _ExtensionDetailState.build.<anonymous closure>.<anonymous closure> (package:mangayomi/modules/browse/extension/extension_detail.dart:173:44)
extension_detail.dart:173
#22     State.setState (package:flutter/src/widgets/framework.dart:1199:30)
framework.dart:1199
#23     _ExtensionDetailState.build.<anonymous closure> (package:mangayomi/modules/browse/extension/extension_detail.dart:171:23)
extension_detail.dart:171
<asynchronous suspension>
```
2025-06-01 19:52:21 +02:00
Moustapha Kodjo Amadou
80efee40d1 dart format 2025-05-30 17:43:42 +01:00
Moustapha Kodjo Amadou
6ea8d088ed + 2025-05-22 18:05:08 +01:00
Moustapha Kodjo Amadou
962bab1cdd upgrade 2025-05-21 18:16:18 +01:00
Moustapha Kodjo Amadou
2371d52661 update to d4rt v0.0.5 2025-05-18 13:20:35 +01:00
Moustapha Kodjo Amadou
206a51df69 + 2025-05-10 12:26:02 +01:00
Moustapha Kodjo Amadou
d250c08424 refactor: update AndroidManifest and MainActivity for APK installation; remove flutter_app_installer dependency 2025-05-09 18:38:23 +01:00
Moustapha Kodjo Amadou
c558c08376 migrate to d4rt package 2025-05-09 17:47:27 +01:00
Schnitzel5
24c4c89418 Merge branch 'temp/epub' into feature/epub 2025-05-07 22:25:11 +02:00
Schnitzel5
3677938bf8 added support for epubs
embedded images not supported yet
2025-05-07 22:17:23 +02:00
Schnitzel5
d6d674c270 + 2025-05-05 20:12:58 +02:00
Schnitzel5
821366cb06 added epubx dependency 2025-05-04 23:45:46 +02:00
Enbiya Olgun
1f118184ba Update m_bridge.dart
Remove code duplication.
2025-04-25 21:32:48 +02:00