public string GetPlatformBoxart(Platform PlatformToLookup, string Downloadpath)
{
if (PlatformToLookup.BoxartURL != null)
{
WebClient FanartDownloader = new WebClient();
try
{
FanartDownloader.DownloadFile(PlatformToLookup.BoxartURL, Downloadpath + "\\" + PlatformToLookup.ID + "_" + PlatformToLookup.Name + ".jpg");
return Downloadpath + "\\" + PlatformToLookup.ID + "_" + PlatformToLookup.Name + ".jpg";
}
catch (Exception e)
{
LogInstance.WriteToFile(3, "Unable to download fanart from thegamesdb with the following URL " + PlatformToLookup.BoxartURL, LogSource);
LogInstance.WriteToFile(3, "Error received was: " + e.Message, LogSource);
return null;
}
}
else
return null;
}