File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ All notable changes to this project will be documented in this file.
2020
2121- [ Docs] Update download count image for Minkowski² (#4474 by: Clayell; reviewed: HebaruSan)
2222- [ Netkan] Fix ` x_netkan_epoch ` not applied before unreliable server check (#4477 by: HebaruSan)
23- - [ Netkan] Gitea kref (#4494 by: HebaruSan)
23+ - [ Netkan] Gitea kref (#4494 , # 4498 by: HebaruSan)
2424
2525## v1.36.2 (Politas)
2626
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ public GithubApi(IHttpService http, string? oauthToken = null)
5050
5151 public GithubRepo ? GetRepo ( GithubRef reference )
5252 => Call ( $ "repos/{ reference . Repository } ") is string s
53- ? JsonConvert . DeserializeObject < GithubRepo > ( s )
53+ ? CheckForWiki ( reference , JsonConvert . DeserializeObject < GithubRepo > ( s ) )
5454 : null ;
5555
5656 public GithubRelease ? GetLatestRelease ( GithubRef reference , bool ? usePrerelease )
@@ -98,6 +98,19 @@ public List<GithubUser> getOrgMembers(GithubUser organization)
9898 : null )
9999 ?? new List < GithubUser > ( ) ;
100100
101+ private GithubRepo ? CheckForWiki ( GithubRef reference , GithubRepo ? repo )
102+ {
103+ if ( repo is { HasWiki : true } )
104+ {
105+ repo . HasWiki = ActuallyHasWiki ( reference ) ;
106+ }
107+ return repo ;
108+ }
109+
110+ private bool ActuallyHasWiki ( GithubRef reference )
111+ // If no wiki pages have been created, the /wiki route redirects and this is null
112+ => _http . DownloadText ( new Uri ( $ "https://github.com/{ reference . Account } /{ reference . Project } /wiki") ) != null ;
113+
101114 /// <summary>
102115 /// Download a URL via the GitHubAPI.
103116 /// Will use a token if we have one.
You can’t perform that action at this time.
0 commit comments