Skip to content

基于自定义规则的番剧采集APP,支持流媒体在线观看,支持弹幕,支持实时超分辨率。

chore: version update enhanced (#2029)

華仔623f3b11810d
diff --git a/lib/utils/utils.dart b/lib/utils/utils.dart
index 4b09ed3b..e3e43b8b 100644
--- a/lib/utils/utils.dart
+++ b/lib/utils/utils.dart
@@ -218,12 +218,15 @@ class Utils {
static bool needUpdate(localVersion, remoteVersion) {
List<String> localVersionList = localVersion.split('.');
List<String> remoteVersionList = remoteVersion.split('.');
- for (int i = 0; i < localVersionList.length; i++) {
- int localVersion = int.parse(localVersionList[i]);
- int remoteVersion = int.parse(remoteVersionList[i]);
- if (remoteVersion > localVersion) {
+ final maxLength = max(localVersionList.length, remoteVersionList.length);
+ for (int i = 0; i < maxLength; i++) {
+ final int localSegment =
+ i < localVersionList.length ? int.parse(localVersionList[i]) : 0;
+ final int remoteSegment =
+ i < remoteVersionList.length ? int.parse(remoteVersionList[i]) : 0;
+ if (remoteSegment > localSegment) {
return true;
- } else if (remoteVersion < localVersion) {
+ } else if (remoteSegment < localSegment) {
return false;
}
}