mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2025-05-19 23:46:55 +08:00
fix: app listing on Home View
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import 'package:github/github.dart';
|
||||
import 'package:injectable/injectable.dart';
|
||||
import 'package:revanced_manager/models/patched_application.dart';
|
||||
import 'package:timeago/timeago.dart';
|
||||
|
||||
@lazySingleton
|
||||
@ -7,12 +8,11 @@ class GithubAPI {
|
||||
var github = GitHub();
|
||||
|
||||
Future<String?> latestRelease(String org, repoName) async {
|
||||
String? dlurl = '';
|
||||
try {
|
||||
var latestRelease = await github.repositories.getLatestRelease(
|
||||
RepositorySlug(org, repoName),
|
||||
);
|
||||
dlurl = latestRelease.assets
|
||||
return latestRelease.assets
|
||||
?.firstWhere((asset) =>
|
||||
asset.name != null &&
|
||||
(asset.name!.endsWith('.dex') || asset.name!.endsWith('.apk')) &&
|
||||
@ -20,24 +20,21 @@ class GithubAPI {
|
||||
!asset.name!.contains('-javadoc'))
|
||||
.browserDownloadUrl;
|
||||
} on Exception {
|
||||
dlurl = '';
|
||||
return '';
|
||||
}
|
||||
return dlurl;
|
||||
}
|
||||
|
||||
Future<String> latestCommitTime(String org, repoName) async {
|
||||
String pushedAt = '';
|
||||
try {
|
||||
var repo = await github.repositories.getRepository(
|
||||
RepositorySlug(org, repoName),
|
||||
);
|
||||
pushedAt = repo.pushedAt != null
|
||||
return repo.pushedAt != null
|
||||
? format(repo.pushedAt!, locale: 'en_short')
|
||||
: '';
|
||||
} on Exception {
|
||||
pushedAt = '';
|
||||
return '';
|
||||
}
|
||||
return pushedAt;
|
||||
}
|
||||
|
||||
Future<List<Contributor>> getContributors(String org, repoName) async {
|
||||
@ -50,4 +47,15 @@ class GithubAPI {
|
||||
return List.empty();
|
||||
}
|
||||
}
|
||||
|
||||
Future<bool> hasUpdates(PatchedApplication app, String org, repoName) async {
|
||||
// TODO: get status based on last update time on the folder of this app?
|
||||
return true;
|
||||
}
|
||||
|
||||
Future<String> getChangelog(
|
||||
PatchedApplication app, String org, repoName) async {
|
||||
// TODO: get changelog based on last commits on the folder of this app?
|
||||
return 'fix: incorrect fingerprint version';
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user