void UpdateCardInSet(string set, JObject setData) { DatabaseManager.LockSet(set.Replace("'", "''")); var cardList = DatabaseManager.GetAllCardsForSet(set.Replace("'", "''")); var json = setData["prints"]; foreach (var card in json) { var id = card["id"].ToString(); var name = card["name"].ToString(); var cardObject = GetMTGStocksData(id); var cardData = ParseCardData(cardObject, set); var prices = GetPriceFromData(cardData); DatabaseManager.UpdatePrice(name, set, prices["price"], false); DatabaseManager.UpdatePrice(name, set, prices["foilPrice"], true); } Logger.LogActivity("Updated price of cards in set:" + set); DatabaseManager.UnlockSet(set.Replace("'", "''")); }