Ejemplo n.º 1
0
        /// <summary>
        /// Downloads images in "original" size and saves them to cache.
        /// </summary>
        /// <param name="image">Image to download</param>
        /// <param name="category">Image category (Poster, Cover, Backdrop...)</param>
        /// <returns><c>true</c> if successful</returns>
        public bool DownloadImage(MovieImage image, string category)
        {
            string cacheFileName = CreateAndGetCacheName(image, category);

            if (string.IsNullOrEmpty(cacheFileName))
            {
                return(false);
            }

            string sourceUri = Configuration.Images.BaseUrl + "original" + image.FilePath;

            _downloader.DownloadFile(sourceUri, cacheFileName);
            return(true);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Downloads images in "original" size and saves them to cache.
        /// </summary>
        /// <param name="image">Image to download</param>
        /// <param name="folderPath">The folder to store the image</param>
        /// <returns><c>true</c> if successful</returns>
        public bool DownloadImage(string Id, ImageItem image, string folderPath)
        {
            string cacheFileName = CreateAndGetCacheName(Id, image, folderPath);

            if (string.IsNullOrEmpty(cacheFileName))
            {
                return(false);
            }

            string sourceUri = Configuration.Images.BaseUrl + "original" + image.FilePath;

            _downloader.DownloadFile(sourceUri, cacheFileName);
            return(true);
        }