protected override RomData ScraperSpecificGetAllData(RomData dataToFillOut) { string finalUrl = String.Format(getDataFormat, dataToFillOut.ScraperUniqueKey); finalUrl = String.Format("{0}{1}", searchRootUrl, finalUrl); string Results = MakeTextRequest(finalUrl, headers); if (Results != String.Empty) { IgdbData resultData = SerializationUtilities.DeserializeString <List <IgdbData> >(Results, DataFormat.JSON, gameModeConverter)[0]; dataToFillOut.Description = String.IsNullOrEmpty(resultData.storyline) ? "No Description Available" : resultData.storyline; dataToFillOut.NumPlayers = resultData.game_modes?.Count() > 0 ? resultData.game_modes[0].NumPlayers : "Unknown"; dataToFillOut.Rating = (float)resultData.rating / 100.0f; dataToFillOut.Publisher = RetrieveCompanyInfo(resultData.publishers); dataToFillOut.Developer = RetrieveCompanyInfo(resultData.developers); RetrieveImages(dataToFillOut, resultData.screenshots); } return(dataToFillOut); }
private string RetrieveCompanyInfo(long[] ids) { if (ids.Length > 0) { string finalUrl = String.Format(getCompanyFormat, ids[0]); finalUrl = String.Format("{0}{1}", searchRootUrl, finalUrl); string Results = MakeTextRequest(finalUrl, headers); if (Results != String.Empty) { IgdbData resultData = SerializationUtilities.DeserializeString <List <IgdbData> >(Results, DataFormat.JSON, gameModeConverter)[0]; return(resultData.name); } else { return("Unknown"); } } else { return("Unknown"); } }