From 061fd46f89116daccfb1941ed5db88c05b810d67 Mon Sep 17 00:00:00 2001 From: zontreck Date: Wed, 14 May 2025 20:59:06 -0700 Subject: [PATCH] Adjust the download URL when on a different channel --- latest-releases.json | 2 +- lib/consts.dart | 4 ++-- lib/pages/UpdateSettings.dart | 2 +- pubspec.yaml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/latest-releases.json b/latest-releases.json index e7c12a6..e8f4557 100644 --- a/latest-releases.json +++ b/latest-releases.json @@ -1,3 +1,3 @@ { - "alpha": "1.0.0-dev.4" + "alpha": "1.0.0-dev.5" } diff --git a/lib/consts.dart b/lib/consts.dart index 8bdd496..a0d3c5a 100644 --- a/lib/consts.dart +++ b/lib/consts.dart @@ -3,9 +3,9 @@ import 'dart:convert'; import 'package:dio/dio.dart'; class TTConsts { - static const UPDATE_URL = + static get UPDATE_URL => "https://git.zontreck.com/AriasCreations/TimeTracker/raw/branch/main/latest-releases.json"; - static const VERSION = "1.0.0-dev.4"; + static const VERSION = "1.0.0-dev.5"; static bool UPDATE_AVAILABLE = false; static UpdateChannel UPDATE_CHANNEL = UpdateChannel.alpha; diff --git a/lib/pages/UpdateSettings.dart b/lib/pages/UpdateSettings.dart index 5a0acaa..7bb0b25 100644 --- a/lib/pages/UpdateSettings.dart +++ b/lib/pages/UpdateSettings.dart @@ -76,7 +76,7 @@ class _UpdSet extends State { onTap: () { OtaUpdate() .execute( - "https://ci.zontreck.com/job/Projects/job/Dart/job/Time%20Tracker/job/main/lastSuccessfulBuild/artifact/build/app/outputs/flutter-apk/timetrack.apk", + "https://ci.zontreck.com/job/Projects/job/Dart/job/Time%20Tracker/job/${TTConsts.UPDATE_CHANNEL == UpdateChannel.stable ? "main" : TTConsts.UPDATE_CHANNEL}/lastSuccessfulBuild/artifact/build/app/outputs/flutter-apk/timetrack.apk", destinationFilename: "timetrack.apk", ) .listen((OtaEvent event) { diff --git a/pubspec.yaml b/pubspec.yaml index 02c44b6..ddf5916 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # In Windows, build-name is used as the major, minor, and patch parts # of the product and file versions while build-number is used as the build suffix. -version: 1.0.0-dev.4 +version: 1.0.0-dev.5 environment: sdk: ^3.7.2