mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2025-05-20 07:56:47 +08:00
feat: add i18n
This commit is contained in:
@ -6,8 +6,9 @@ class GithubAPI {
|
||||
var github = GitHub();
|
||||
|
||||
Future<String?> latestRelease(String org, repoName) async {
|
||||
var latestRelease = await github.repositories
|
||||
.getLatestRelease(RepositorySlug(org, repoName));
|
||||
var latestRelease = await github.repositories.getLatestRelease(
|
||||
RepositorySlug(org, repoName),
|
||||
);
|
||||
var dlurl = latestRelease.assets
|
||||
?.firstWhere((asset) =>
|
||||
asset.name != null &&
|
||||
@ -18,32 +19,10 @@ class GithubAPI {
|
||||
return dlurl;
|
||||
}
|
||||
|
||||
Future latestCommitTime(String org, repoName) async {
|
||||
var repo =
|
||||
await github.repositories.getRepository(RepositorySlug(org, repoName));
|
||||
|
||||
var commitTime = repo.pushedAt?.difference(
|
||||
DateTime.now().toLocal(),
|
||||
Future<DateTime?> latestCommitTime(String org, repoName) async {
|
||||
var repo = await github.repositories.getRepository(
|
||||
RepositorySlug(org, repoName),
|
||||
);
|
||||
|
||||
final hours = commitTime!.inHours.abs();
|
||||
|
||||
if (hours > 24) {
|
||||
var days = (commitTime.inDays).abs().toString();
|
||||
return "$days days";
|
||||
} else if (hours > 1 && hours < 24) {
|
||||
var hours = (commitTime.inHours).abs().toString();
|
||||
return "$hours hours";
|
||||
} else {
|
||||
var minutes = (commitTime.inMinutes).abs().toString();
|
||||
return "$minutes mins";
|
||||
}
|
||||
}
|
||||
|
||||
Future contributors(String org, repoName) async {
|
||||
var contributors =
|
||||
github.repositories.listContributors(RepositorySlug(org, repoName));
|
||||
contributors.forEach((contributor) {});
|
||||
return contributors;
|
||||
return repo.pushedAt;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user