﻿using System;
using System.IO;
using System.Net.Http;
using System.Threading.Tasks;

namespace RelicAccess
{
    public class ImageDownloader
    {
        private const string root = "";

        public static async Task<Stream> GetImageStreamAsync(string imageId, string suffixCode = "")
        {
            var subPath = imageId.Substring(0, 6);
            using (var client = new HttpClient())
                return await client.GetStreamAsync(String.Format("{0}/{1}/{2}{3}", root, subPath, imageId, suffixCode));
        }
    }
}
