Fixed more stuff like var names.

This commit is contained in:
MelonSpeedruns 2020-01-26 12:41:32 -05:00 committed by Ash
commit ccdfbfb2f0
2 changed files with 22 additions and 21 deletions

View file

@ -61,7 +61,7 @@ namespace Ryujinx.Ui
SecondaryText = secText, SecondaryText = secText,
WindowPosition = WindowPosition.Center WindowPosition = WindowPosition.Center
}; };
Uri URL = new Uri(UpdateParser.BuildArt); Uri URL = new Uri(UpdateParser._buildArt);
UpdateParser.Package.DownloadFileAsync(URL, Path.Combine(UpdateParser.RyuDir, "Data", "Update", "RyujinxPackage.zip")); UpdateParser.Package.DownloadFileAsync(URL, Path.Combine(UpdateParser.RyuDir, "Data", "Update", "RyujinxPackage.zip"));
messageDialog.SetSizeRequest(100, 20); messageDialog.SetSizeRequest(100, 20);

View file

@ -15,14 +15,15 @@ namespace Ryujinx.Updater.Parser
{ {
public class UpdateParser public class UpdateParser
{ {
private static string _jobid; private static string _jobId;
private static string _buildver; private static string _buildVer;
private static string _buildurl = "https://ci.appveyor.com/api/projects/gdkchan/ryujinx/branch/master"; private static string _buildUrl = "https://ci.appveyor.com/api/projects/gdkchan/ryujinx/branch/master";
private static string _buildcommit; private static string _buildCommit;
private static string _branch; private static string _branch;
private static string _platformext; private static string _platformExt;
public static string _buildArt;
public static string BuildArt;
public static string RyuDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Ryujinx"); public static string RyuDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Ryujinx");
public static WebClient Package = new WebClient(); public static WebClient Package = new WebClient();
public static int PackageProgress; public static int PackageProgress;
@ -38,41 +39,41 @@ namespace Ryujinx.Updater.Parser
{ {
if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
{ {
_platformext = "osx_x64.zip"; _platformExt = "osx_x64.zip";
} }
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) else if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{ {
_platformext = "win_x64.zip"; _platformExt = "win_x64.zip";
} }
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
{ {
_platformext = "linux_x64.tar.gz"; _platformExt = "linux_x64.tar.gz";
} }
} }
// Begin the Appveyor parsing // Begin the Appveyor parsing
WebClient jsonClient = new WebClient(); WebClient jsonClient = new WebClient();
string fetchedJSON = jsonClient.DownloadString(_buildurl); string fetchedJSON = jsonClient.DownloadString(_buildUrl);
JObject jsonRoot = JObject.Parse(fetchedJSON); JObject jsonRoot = JObject.Parse(fetchedJSON);
var __Build = jsonRoot["build"]; var __Build = jsonRoot["build"];
string __Version = (string)__Build["version"]; string __Version = (string)__Build["version"];
string __JobsID = (string)__Build["jobs"][0]["jobId"]; string __JobsId = (string)__Build["jobs"][0]["jobId"];
string __branch = (string)__Build["branch"]; string __branch = (string)__Build["branch"];
string __buildcommit = (string)__Build["commitId"]; string __buildCommit = (string)__Build["commitId"];
_jobid = __JobsID; _jobId = __JobsId;
_buildver = __Version; _buildVer = __Version;
BuildArt = "https://ci.appveyor.com/api/buildjobs/" + _jobid + "/artifacts/ryujinx-" + _buildver + "-" + _platformext; _buildArt = "https://ci.appveyor.com/api/buildjobs/" + _jobId + "/artifacts/ryujinx-" + _buildVer + "-" + _platformExt;
_buildcommit = __buildcommit.Substring(0, 7); _buildCommit = __buildCommit.Substring(0, 7);
_branch = __branch; _branch = __branch;
Logger.PrintInfo(LogClass.Application, "Fetched JSON and Parsed:" + Environment.NewLine + "MetaData: JobID(" + __JobsID + ") BuildVer(" + __Version + ")" + Environment.NewLine + "BuildURL(" + BuildArt + ")"); Logger.PrintInfo(LogClass.Application, "Fetched JSON and Parsed:" + Environment.NewLine + "MetaData: JobID(" + __JobsId + ") BuildVer(" + __Version + ")" + Environment.NewLine + "BuildURL(" + _buildArt + ")");
Logger.PrintInfo(LogClass.Application, "Commit-id: (" + _buildcommit + ")" + " Branch: (" + _branch + ")"); Logger.PrintInfo(LogClass.Application, "Commit-id: (" + _buildCommit + ")" + " Branch: (" + _branch + ")");
using (MessageDialog dialog = GtkDialog.CreateAcceptDialog("Update", "Ryujinx - Update", "Would you like to update?", "Version " + _buildver + " is available.")) using (MessageDialog dialog = GtkDialog.CreateAcceptDialog("Update", "Ryujinx - Update", "Would you like to update?", "Version " + _buildVer + " is available."))
{ {
if (dialog.Run() == (int)ResponseType.Yes) if (dialog.Run() == (int)ResponseType.Yes)
{ {
@ -106,7 +107,7 @@ namespace Ryujinx.Updater.Parser
Package.DownloadProgressChanged += new DownloadProgressChangedEventHandler(PackageDownloadProgress); Package.DownloadProgressChanged += new DownloadProgressChangedEventHandler(PackageDownloadProgress);
Package.DownloadFileCompleted += new AsyncCompletedEventHandler(PackageDownloadedAsync); Package.DownloadFileCompleted += new AsyncCompletedEventHandler(PackageDownloadedAsync);
using (MessageDialog dialog = GtkDialog.CreateProgressDialog("Update", "Ryujinx - Update", "Downloading update " + _buildver, "Please wait while we download the latest package and extract it.")) using (MessageDialog dialog = GtkDialog.CreateProgressDialog("Update", "Ryujinx - Update", "Downloading update " + _buildVer, "Please wait while we download the latest package and extract it."))
{ {
dialog.Run(); dialog.Run();
} }