Example #1
0
        private void GetMetadataCDN_Click(object sender, EventArgs e)
        {
            if (Meta.npdm.TitleID == null)
            {
                Meta = GameList.ParseGameFiles(PathText.Text);
            }
            GameList.GameListNACP nacp = NintendoCDN.GetGameMetadata(Meta.npdm.TitleID);
            GameName.Text      = nacp.TitleName;
            PublisherName.Text = nacp.Publisher;

            Image  image       = Image.FromFile("./Images/GameThumbnails/" + Meta.npdm.TitleID + ".jpg");
            Bitmap scaledImage = ResizeImage(image, 256, 256);

            Thumbnail.Image = scaledImage;
        }
Example #2
0
        private void ScanDir_Click(object sender, EventArgs e)
        {
            if (Settings.GET_METADATA_FROM_CDN)
            {
                entrysfound = new List <GameList.GameListEntry>();
                int foundgames   = 0;
                int skippedgames = 0;

                foreach (string dir in Directory.GetDirectories(PathText.Text))
                {
                    if (GameList.IsGameDirectoryValid(dir))
                    {
                        ScanState.Text = "Games found: " + foundgames + "\nSkipped Games (Aka Games not found on the CDN): " + skippedgames + "\n(This process may take a while)";
                        GameList.GameListMetaData metaData = GameList.ParseGameFiles(dir);
                        metaData.nacp = NintendoCDN.GetGameMetadata(metaData.npdm.TitleID);

                        if (metaData.nacp.TitleName == null)
                        {
                            ++skippedgames;
                            continue;
                        }

                        entrysfound.Add(new GameList.GameListEntry
                        {
                            AppName   = metaData.nacp.TitleName,
                            Publisher = metaData.nacp.Publisher,
                            TitleID   = metaData.npdm.TitleID,
                            GamePath  = dir
                        });

                        ++foundgames;
                    }
                }

                ScanState.Text = "All Games found: " + foundgames + "\nAll Games Skipped: " + skippedgames;
            }
            else if (Settings.USE_NUCLEUS)
            {
                entrysfound = new List <GameList.GameListEntry>();
                int foundgames   = 0;
                int skippedgames = 0;

                foreach (string dir in Directory.GetDirectories(PathText.Text))
                {
                    if (GameList.IsGameDirectoryValid(dir))
                    {
                        ScanState.Text = "Games found: " + foundgames + "\nSkipped Games (Aka Games not found on the CDN): " + skippedgames + "\n(This process may take a while)";
                        GameList.GameListMetaData metaData = GameList.ParseGameFiles(dir);
                        NucleusCDN.GameHeader     header   = NucleusCDN.MakeHeadRequest(metaData.npdm.TitleID);

                        if (header.Return == NucleusCDN.ReturnType.Success)
                        {
                            if (!File.Exists("./Images/GameThumbnails/" + metaData.npdm.TitleID + ".jpg"))
                            {
                                File.WriteAllBytes("./Images/GameThumbnails/" + metaData.npdm.TitleID + ".jpg", NucleusCDN.MakeIconRequest(metaData.npdm.TitleID));
                            }

                            entrysfound.Add(new GameList.GameListEntry
                            {
                                AppName   = header.GameName,
                                Publisher = header.Publisher,
                                TitleID   = metaData.npdm.TitleID,
                                GamePath  = dir
                            });

                            ++foundgames;
                        }
                        else
                        {
                            ++skippedgames;
                            continue;
                        }
                    }
                }

                ScanState.Text = "All Games found: " + foundgames + "\nAll Games Skipped: " + skippedgames;
            }
        }