mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-12-09 08:47:31 +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: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
nightlyBuildNum != null
|
nightlyBuildNum != null
|
||||||
? "Spotube Nightly $nightlyBuildNum has been releases"
|
? "Spotube Nightly $nightlyBuildNum has been released"
|
||||||
: "Spotube v$version has been released",
|
: "Spotube v$version has been released",
|
||||||
),
|
),
|
||||||
if (nightlyBuildNum != null)
|
if (nightlyBuildNum == null)
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
|
|||||||
@ -340,16 +340,12 @@ abstract class ServiceUtils {
|
|||||||
if (Env.releaseChannel == ReleaseChannel.nightly) {
|
if (Env.releaseChannel == ReleaseChannel.nightly) {
|
||||||
final value = await http.get(
|
final value = await http.get(
|
||||||
Uri.parse(
|
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 =
|
||||||
|
jsonDecode(value.body)["workflow_runs"][0]["run_number"] as int;
|
||||||
final buildNum = int.tryParse(
|
|
||||||
RegExp(r'Build Number: (\d+)').firstMatch(body)?.group(1) ?? '0',
|
|
||||||
) ??
|
|
||||||
0;
|
|
||||||
|
|
||||||
if (buildNum <= int.parse(packageInfo.buildNumber) || !context.mounted) {
|
if (buildNum <= int.parse(packageInfo.buildNumber) || !context.mounted) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user