예제 #1
0
        public virtual bool Download(Series series)
        {
            var bannerPath = _environmentProvider.GetBannerPath();

            logger.Trace("Ensuring Banner Folder exists: ", bannerPath);
            _diskProvider.CreateDirectory(bannerPath);

            var bannerFilename = Path.Combine(bannerPath, series.SeriesId.ToString()) + ".jpg";

            logger.Trace("Downloading banner for '{0}'", series.Title);

            try
            {
                _httpProvider.DownloadFile(BANNER_URL_PREFIX + series.BannerUrl, bannerFilename);
                logger.Trace("Successfully download banner for '{0}'", series.Title);
            }
            catch (Exception)
            {
                logger.Debug("Failed to download banner for '{0}'", series.Title);
                return(false);
            }

            return(true);
        }