Exemple #1
0
        public static void addGameToJson(string name, string exe)
        {
            var items = loadJson();

            Search.Game game = new Search.Game();
            GameObj     item = new GameObj();

            item.name = name;
            item.exe  = new List <string>();
            item.exe.Add(exe);
            item.igdbId = -1;

            //var t = game.byQuery(item.name).Result;
            //item.igdbId = (long)t.Id;
            //item.cover = t.Cover.Value.Url.Replace("t_thumb", "t_1080p");
            items.Add(item);
            saveJson(items.ToArray());
        }
Exemple #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Search.Game gamesearch = new Search.Game();

            if (fbd is null)
            {
                fbd       = new FolderBrowserDialog();
                threadold = Thread.CurrentThread;
            }

            Debug.WriteLine(Thread.CurrentThread == threadold);

            if (fbd.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            scanAndAppend(fbd.SelectedPath);
        }
Exemple #3
0
        public void populateJson()
        {
            var items = loadJson();

            Search.Game game = new Search.Game();
            bool        changedAtLeastOne = false;

            for (var i = 0; i < items.Count; i++)
            {
                if (items[i].igdbId == -1)
                {
                    var t = game.byQuery(items[i].name).Result;
                    items[i].igdbId   = (long)t.Id;
                    items[i].cover    = t.Cover.Value.Url.Replace("t_thumb", "t_1080p");
                    changedAtLeastOne = true;
                }
            }

            if (changedAtLeastOne)
            {
                saveJson(items.ToArray());
            }
        }