/// <summary> /// Downloads the attachment file, or gets it from the cache if it's already been downloaded. /// </summary> public async Task <string> DownloadOrCacheAsync(ITimelineService api) { string url = await GenerateGetPresignedUrlAsync(api); // Download attachment if it doesn't exist in the cache. var file = Path.Combine(api.CacheFolder, Name); if (!api.FileExists(file)) { await api.DownloadFileAsync(url, file); } Debug.WriteLine("URL: " + url); Debug.WriteLine("Filename: " + file); return(file); }