Skip to content

Commit

Permalink
New links for Version List
Browse files Browse the repository at this point in the history
  • Loading branch information
garoxas committed Oct 20, 2019
1 parent 04d6e07 commit 82a4149
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 20 deletions.
4 changes: 2 additions & 2 deletions NX_Game_Info/Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public class Common
public static readonly string TITLE_KEYS = "title.keys";
public static readonly string CONSOLE_KEYS = "console.keys";
public static readonly string HAC_VERSIONLIST = "hac_versionlist.json";
public static readonly string TITLE_KEYS_URI = "https://pastebin.com/raw/XGfpTfb7";
public static readonly string HAC_VERSIONLIST_URI = "https://pastebin.com/raw/imV40MSg";
public static readonly string TITLE_KEYS_URI = "https://gist.githubusercontent.com/gneurshkgau/81bcaa7064bd8f98d7dffd1a1f1781a7/raw/title.keys";
public static readonly string HAC_VERSIONLIST_URI = "https://gist.githubusercontent.com/gneurshkgau/81bcaa7064bd8f98d7dffd1a1f1781a7/raw/hac_versionlist.json";

#if WINDOWS
[DllImport("Shlwapi.dll", CharSet = CharSet.Auto)]
Expand Down
24 changes: 6 additions & 18 deletions NX_Game_Info/Process.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,14 +126,8 @@ public static bool initialize(out List<string> messages)
titleID = titleID.Substring(0, Math.Min(titleID.Length, 13)) + "000";
}

if (versionList.ContainsKey(titleID.ToUpper()))
{
versionList[titleID.ToUpper()] = Math.Max(versionList[titleID.ToUpper()], title.version);
}
else
{
versionList.Add(titleID.ToUpper(), title.version);
}
versionList.TryGetValue(titleID.ToUpper(), out uint version);
versionList[titleID.ToUpper()] = Math.Max(version, title.version);
}

log?.WriteLine("Found {0} titles, last modified at {1}", versionList.Count, versionlist.last_modified);
Expand Down Expand Up @@ -228,8 +222,8 @@ public static bool updateTitleKeys()

log?.WriteLine("Found {0} title keys", keyset?.TitleKeys?.Count);

titleNames = keyset.TitleNames.ToDictionary(p => BitConverter.ToString(p.Key.Take(8).ToArray()).Replace("-", "").ToUpper(), p => p.Value);
titleVersions = keyset.TitleVersions.ToDictionary(p => BitConverter.ToString(p.Key.Take(8).ToArray()).Replace("-", "").ToUpper(), p => p.Value);
titleNames = keyset.TitleNames.GroupBy(p => BitConverter.ToString(p.Key.Take(8).ToArray()).Replace("-", "").ToUpper()).ToDictionary(p => p.Key, p => p.Last().Value);
titleVersions = keyset.TitleVersions.GroupBy(p => BitConverter.ToString(p.Key.Take(8).ToArray()).Replace("-", "").ToUpper()).ToDictionary(p => p.Key, p => p.Last().Value);

return true;
}
Expand Down Expand Up @@ -270,14 +264,8 @@ public static bool updateVersionList()
titleID = titleID.Substring(0, Math.Min(titleID.Length, 13)) + "000";
}

if (versionList.ContainsKey(titleID.ToUpper()))
{
versionList[titleID.ToUpper()] = Math.Max(versionList[titleID.ToUpper()], title.version);
}
else
{
versionList.Add(titleID.ToUpper(), title.version);
}
versionList.TryGetValue(titleID.ToUpper(), out uint version);
versionList[titleID.ToUpper()] = Math.Max(version, title.version);
}

log?.WriteLine("Found {0} titles, last modified at {1}", versionList.Count, versionlist.last_modified);
Expand Down

0 comments on commit 82a4149

Please sign in to comment.