Skip to content

Commit

Permalink
add some comment
Browse files Browse the repository at this point in the history
  • Loading branch information
appdevelpo committed Apr 14, 2024
1 parent ef07942 commit 88bfad4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions lib/data/services/extension_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ class ExtensionService {
initRuntime(Extension ext) async {
extension = ext;
className = extension.package.replaceAll('.', '');
// example: if the package name is com.example.extension the class name will be comexampleextension
// but if the package name is 9anime.to the class name will be animetoRenamed

if (!className.isAlphabetOnly) {
className = "${className.replaceAll(RegExp(r'[^a-zA-z]'), '')}Renamed";
}
Expand Down Expand Up @@ -151,8 +154,6 @@ class ExtensionService {
return setting!.value ?? setting.defaultValue;
}

runtime.onMessage('getSetting', (dynamic args) => jsGetMessage(args));

jsCleanSettings(dynamic args) async {
// debugPrint('cleanSettings: ${args[0]}');
return DatabaseService.cleanExtensionSettings(
Expand Down Expand Up @@ -235,6 +236,7 @@ class ExtensionService {
return elements;
}

runtime.onMessage('getSetting', (dynamic args) => jsGetMessage(args));
// 日志
runtime.onMessage('log', (args) => jsLog(args));
// 请求
Expand Down Expand Up @@ -441,6 +443,7 @@ async function stringify(callback) {
}
'''
: '''
// 重写 console.log
Expand Down
7 changes: 5 additions & 2 deletions lib/utils/bt_server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ class BTServerUtils {
}) async {
debugPrint("检测最新版本");
// 获取最新版本
// const url =
// "https://api.github.com/repos/miru-project/bt-server/releases/latest";
const url =
"https://api.github.com/repos/appdevelpo/bt-server/releases/latest"; // temporary url

Expand Down Expand Up @@ -59,9 +61,10 @@ class BTServerUtils {
}

debugPrint("下载 bt-server $remoteVersion $platform $arch");

// final downloadUrl =
// "https://github.com/miru-project/bt-server/releases/download/$remoteVersion/bt-server-$remoteVersion-$platform-$arch";
final downloadUrl =
"https://github.com/appdevelpo/bt-server/releases/download/$remoteVersion/bt-server-$remoteVersion-$platform-$arch";
"https://github.com/appdevelpo/bt-server/releases/download/$remoteVersion/bt-server-$remoteVersion-$platform-$arch"; // temporary url

final savePath = MiruDirectory.getDirectory;
await dio.download(
Expand Down

0 comments on commit 88bfad4

Please sign in to comment.