mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-12-08 00:17:29 +00:00
chore: fix some errors parsing nightly version info
This commit is contained in:
parent
5726de8bbc
commit
5d619ca036
@ -31,10 +31,10 @@ class RootAppUpdateDialog extends StatelessWidget {
|
||||
children: [
|
||||
Text(
|
||||
nightlyBuildNum != null
|
||||
? "Spotube Nightly $nightlyBuildNum has been releases"
|
||||
? "Spotube Nightly $nightlyBuildNum has been released"
|
||||
: "Spotube v$version has been released",
|
||||
),
|
||||
if (nightlyBuildNum != null)
|
||||
if (nightlyBuildNum == null)
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
|
||||
@ -340,16 +340,12 @@ abstract class ServiceUtils {
|
||||
if (Env.releaseChannel == ReleaseChannel.nightly) {
|
||||
final value = await http.get(
|
||||
Uri.parse(
|
||||
"https://api.github.com/repos/KRTirtho/spotube/releases/tags/nightly",
|
||||
"https://api.github.com/repos/KRTirtho/spotube/actions/workflows/spotube-release-binary.yml/runs?status=success&per_page=1",
|
||||
),
|
||||
);
|
||||
|
||||
final body = jsonDecode(value.body)["body"] as String;
|
||||
|
||||
final buildNum = int.tryParse(
|
||||
RegExp(r'Build Number: (\d+)').firstMatch(body)?.group(1) ?? '0',
|
||||
) ??
|
||||
0;
|
||||
final buildNum =
|
||||
jsonDecode(value.body)["workflow_runs"][0]["run_number"] as int;
|
||||
|
||||
if (buildNum <= int.parse(packageInfo.buildNumber) || !context.mounted) {
|
||||
return;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user