diff --git a/lib/services/github_api.dart b/lib/services/github_api.dart index 77774bda..81cfc66e 100644 --- a/lib/services/github_api.dart +++ b/lib/services/github_api.dart @@ -16,10 +16,10 @@ class GithubAPI { 'com.garzotto.pflotsh.ecmwf_a': 'ecmwf', }; - Future latestReleaseVersion(String org, String repoName) async { + Future latestReleaseVersion(String repoName) async { try { var latestRelease = await _github.repositories.getLatestRelease( - RepositorySlug(org, repoName), + RepositorySlug.full(repoName), ); return latestRelease.tagName; } on Exception { @@ -27,14 +27,10 @@ class GithubAPI { } } - Future latestReleaseFile( - String extension, - String org, - String repoName, - ) async { + Future latestReleaseFile(String extension, String repoName) async { try { var latestRelease = await _github.repositories.getLatestRelease( - RepositorySlug(org, repoName), + RepositorySlug.full(repoName), ); String? url = latestRelease.assets ?.firstWhere((asset) => @@ -52,10 +48,10 @@ class GithubAPI { return null; } - Future latestCommitTime(String org, String repoName) async { + Future latestCommitTime(String repoName) async { try { var repo = await _github.repositories.getRepository( - RepositorySlug(org, repoName), + RepositorySlug.full(repoName), ); return repo.pushedAt != null ? format(repo.pushedAt!, locale: 'en_short') @@ -65,15 +61,14 @@ class GithubAPI { } } - Future> getContributors(String org, String repoName) async { + Future> getContributors(String repoName) async { return await (_github.repositories.listContributors( - RepositorySlug(org, repoName), + RepositorySlug.full(repoName), )).toList(); } Future> getCommits( String packageName, - String org, String repoName, ) async { String path = @@ -81,7 +76,7 @@ class GithubAPI { return await (PaginationHelper(_github) .objects, RepositoryCommit>( 'GET', - '/repos/$org/$repoName/commits', + '/repos/$repoName/commits', (i) => RepositoryCommit.fromJson(i), params: {'path': path}, )).toList();