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

GetPlatformFanart() public method

public GetPlatformFanart ( System.Platform PlatformToLookup, string Downloadpath ) : string
PlatformToLookup System.Platform
Downloadpath string
return string
        public string GetPlatformFanart(Platform PlatformToLookup, string Downloadpath)
        {
            if (PlatformToLookup.FanartURL != null)
            {
                WebClient FanartDownloader = new WebClient();
                try
                {
                    FanartDownloader.DownloadFile(PlatformToLookup.FanartURL, 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.FanartURL, LogSource);
                    LogInstance.WriteToFile(3, "Error received was: " + e.Message, LogSource);
                    return null;
                }
            }
            else
                return null;
        }