diff --git a/lib/modules/more/about/providers/check_for_update.dart b/lib/modules/more/about/providers/check_for_update.dart index 6035275a..2b0062a8 100644 --- a/lib/modules/more/about/providers/check_for_update.dart +++ b/lib/modules/more/about/providers/check_for_update.dart @@ -80,7 +80,7 @@ Future _launchInBrowser(Uri url) async { } Future<(String, String, String)> _checkUpdate() async { - final http = MClient.init(); + final http = MClient.init(reqcopyWith: {'useDartHttpClient': true}); try { final res = await http.get(Uri.parse( "https://api.github.com/repos/kodjodevf/Mangayomi/releases?page=1&per_page=10")); diff --git a/lib/services/aniskip.dart b/lib/services/aniskip.dart index 1da20759..d685ec25 100644 --- a/lib/services/aniskip.dart +++ b/lib/services/aniskip.dart @@ -6,7 +6,7 @@ part 'aniskip.g.dart'; // credits: https://github.com/aniyomiorg/aniyomi/blob/master/app/src/main/java/eu/kanade/tachiyomi/util/AniSkipApi.kt @riverpod class AniSkip extends _$AniSkip { - final http = MClient.init(); + final http = MClient.init(reqcopyWith: {'useDartHttpClient': true}); @override void build() {} diff --git a/lib/services/fetch_sources_list.dart b/lib/services/fetch_sources_list.dart index fa3710c4..bbc5a0be 100644 --- a/lib/services/fetch_sources_list.dart +++ b/lib/services/fetch_sources_list.dart @@ -15,7 +15,7 @@ Future fetchSourcesList( required String sourcesIndexUrl, required AutoDisposeRef ref, required bool isManga}) async { - final http = MClient.init(); + final http = MClient.init(reqcopyWith: {'useDartHttpClient': true}); final req = await http.get(Uri.parse(sourcesIndexUrl)); final sourceList = diff --git a/lib/services/torrent_server.dart b/lib/services/torrent_server.dart index 62407b83..6bac69fc 100644 --- a/lib/services/torrent_server.dart +++ b/lib/services/torrent_server.dart @@ -10,6 +10,7 @@ import 'package:mangayomi/providers/storage_provider.dart'; import 'package:mangayomi/services/http/m_client.dart'; import 'package:mangayomi/utils/extensions/string_extensions.dart'; import 'package:mangayomi/ffi/torrent_server_ffi.dart' as libmtorrentserver_ffi; + class MTorrentServer { final http = MClient.init(); Future removeTorrent(String? inforHash) async { @@ -49,7 +50,7 @@ class MTorrentServer { request.files.add(MultipartFile.fromBytes('file', torrentByte, filename: 'file.torrent')); - StreamedResponse response = await request.send(); + final response = await http.send(request); return await response.stream.bytesToString(); } catch (e) { rethrow; diff --git a/lib/services/trackers/anilist.dart b/lib/services/trackers/anilist.dart index a102070b..aa943af4 100644 --- a/lib/services/trackers/anilist.dart +++ b/lib/services/trackers/anilist.dart @@ -14,7 +14,7 @@ part 'anilist.g.dart'; @riverpod class Anilist extends _$Anilist { - final http = MClient.init(); + final http = MClient.init(reqcopyWith: {'useDartHttpClient': true}); final String _clientId = (Platform.isWindows || Platform.isLinux) ? '13587' : '13588'; static const String _baseApiUrl = "https://graphql.anilist.co/"; diff --git a/lib/services/trackers/kitsu.dart b/lib/services/trackers/kitsu.dart index 2eaa3f54..a8b407f8 100644 --- a/lib/services/trackers/kitsu.dart +++ b/lib/services/trackers/kitsu.dart @@ -14,7 +14,7 @@ part 'kitsu.g.dart'; @riverpod class Kitsu extends _$Kitsu { - final http = MClient.init(); + final http = MClient.init(reqcopyWith: {'useDartHttpClient': true}); final String _clientId = 'dd031b32d2f56c990b1425efe6c42ad847e7fe3ab46bf1299f05ecd856bdb7dd'; final String _clientSecret = diff --git a/lib/services/trackers/myanimelist.dart b/lib/services/trackers/myanimelist.dart index 3260a373..e2126935 100644 --- a/lib/services/trackers/myanimelist.dart +++ b/lib/services/trackers/myanimelist.dart @@ -15,7 +15,7 @@ part 'myanimelist.g.dart'; @riverpod class MyAnimeList extends _$MyAnimeList { - final http = MClient.init(); + final http = MClient.init(reqcopyWith: {'useDartHttpClient': true}); String baseOAuthUrl = 'https://myanimelist.net/v1/oauth2'; String baseApiUrl = 'https://api.myanimelist.net/v2'; String codeVerifier = "";