using System.Text; using System.Text.Json; using System.Collections.Generic; using Microsoft.Extensions.Caching.Distributed; using Microsoft.Extensions.Options; using Amazon.S3; using MetaAssets; using UGQApiServer.Models; using UGQApiServer.Settings; using UGQApiServer.Storage; using UGQDatabase.Models; using UGQDataAccess.Settings; namespace UGQApiServer.UGQData; public class UGQBannerImageList { readonly AmazonS3Client _s3Client; readonly S3Settings _settings; public UGQBannerImageList(IOptions settings) { _settings = settings.Value; _s3Client = new AmazonS3Client(_settings.AccessKey, _settings.SecretAccessKey, Amazon.RegionEndpoint.USEast1); } public async Task> getFiles() { var res = await _s3Client.ListObjectsAsync(_settings.BucketName, "preset"); return res.S3Objects.Where(x => x.Key.EndsWith(".png")) .Select(x => x.Key).ToList(); } }