FreakOut.classes.Scraper.TheGamesDB.GetPlatformBoxart C# (CSharp) Method

GetPlatformBoxart() public method

public GetPlatformBoxart ( System.Platform PlatformToLookup, string Downloadpath ) : string
PlatformToLookup System.Platform
Downloadpath string
return string
        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;
        }