Skip to content

Commit

Permalink
Support latest release Akebi again.
Browse files Browse the repository at this point in the history
  • Loading branch information
akbaryahya committed Sep 28, 2022
1 parent 6d65c53 commit 0959d52
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 18 deletions.
8 changes: 4 additions & 4 deletions Download.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ namespace YuukiPS_Launcher
{
public partial class Download : Form
{
private string set_download;
private string set_folder;
private string set_download = "";
private string set_folder = "";
private DownloadService dl;

public Download(string url_download, string folder_download)
public Download(string url_download = "", string folder_download = "")
{
set_download = url_download;
set_folder = folder_download;
Expand Down Expand Up @@ -114,7 +114,7 @@ private void Dl_DownloadProgressChanged(object? sender, DownloadProgressChangedE

private void Dl_DownloadStarted(object? sender, DownloadStartedEventArgs e)
{
Console.WriteLine("Start Download: " + e.FileName);
Console.WriteLine("Start Download: " + set_download);
}

private void btCancel_Click(object sender, EventArgs e)
Expand Down
2 changes: 1 addition & 1 deletion Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ private void btStart_Click(object sender, EventArgs e)

var Update_AkebiGC = false;

var cekAkebi = API.GetAkebi(GameChannel);
var cekAkebi = API.GetAkebi(GameChannel, VersionGame);
if (string.IsNullOrEmpty(cekAkebi))
{
MessageBox.Show("Can't check latest Akebi");
Expand Down
34 changes: 23 additions & 11 deletions Yuuki/API.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class API
public static string API_DL_OW = "https://drive.yuuki.me/";
public static string API_DL_WB = "https://ps.yuuki.me/api/";
public static string API_GITHUB_YuukiPS = "https://api.github.com/repos/akbaryahya/YuukiPS-Launcher/";
public static string API_GITHUB_Akebi = "https://api.github.com/repos/Akebi-Group/Akebi-GC/";
public static string API_GITHUB_Akebi = "https://api.github.com/repos/Taiga74164/Akebi-GC/";

public static GS GS_DL(string dl = "os")
{
Expand Down Expand Up @@ -180,34 +180,46 @@ public static GS GS_DL(string dl = "os")
return null;
}

public static string? GetAkebi(int ch = 1)
public static string? GetAkebi(int ch = 1, string ver_set = "3.1")
{
var client = new RestClient(API_GITHUB_Akebi);
var request = new RestRequest("actions/artifacts");
var request = new RestRequest("releases");
var response = client.Execute(request);

var whos = "master";
var whos = "global";
if (ch == 2)
{
whos = "chinese";
whos = "china";
}

ver_set = ver_set.Replace(".0", "");

if (response.StatusCode == HttpStatusCode.OK)
{
if (response.Content != null)
{
try
{
var tes = JsonConvert.DeserializeObject<Nightly>(response.Content);
if (tes != null)
var GetData = JsonConvert.DeserializeObject<List<Update>>(response.Content);
if (GetData != null)
{
foreach (var file in tes.artifacts)
// Get List Releases
foreach (var GetVersion in GetData)
{
if (file.workflow_run != null)
if (GetVersion.name.Contains(ver_set))
{
if (file.workflow_run.head_branch == whos)
var version = GetVersion.tag_name + "_" + whos + "_" + ver_set;
var aseet = GetVersion.assets;
if (aseet != null)
{
return file.workflow_run.head_sha + "|https://nightly.link/Akebi-Group/Akebi-GC/actions/runs/" + file.workflow_run.id + "/" + file.name + ".zip";
// Get List Asset
foreach (var file in aseet)
{
if (file.name.Contains(whos))
{
return version + "|" + file.browser_download_url;
}
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions YuukiPS Launcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

<ApplicationManifest>Properties\app.manifest</ApplicationManifest>

<AssemblyVersion>2022.9.27.0535</AssemblyVersion>
<FileVersion>2022.9.27.0535</FileVersion>
<AssemblyVersion>2022.9.28.2255</AssemblyVersion>
<FileVersion>2022.9.28.2255</FileVersion>

<EnableWindowsTargeting>true</EnableWindowsTargeting>
<AssemblyName>YuukiPS</AssemblyName>
Expand Down

0 comments on commit 0959d52

Please sign in to comment.