Add endpoint to download multidata directly
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
namespace ALttPRandomizer.Azure {
|
||||
using global::Azure.Storage.Blobs;
|
||||
using global::Azure.Storage.Blobs.Models;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -64,6 +63,20 @@
|
||||
return data;
|
||||
}
|
||||
|
||||
public async Task<BinaryData?> GetFile(string filename) {
|
||||
var blob = this.BlobClient.GetBlobClient(filename);
|
||||
var exists = await blob.ExistsAsync();
|
||||
if (!exists.HasValue || !exists.Value) {
|
||||
return null;
|
||||
}
|
||||
var result = await blob.DownloadContentAsync();
|
||||
if (result.HasValue) {
|
||||
return result.Value.Content;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<DateTimeOffset> GetFileCreation(string filename) {
|
||||
var blob = this.BlobClient.GetBlobClient(filename);
|
||||
var blobProperties = await blob.GetPropertiesAsync();
|
||||
|
||||
Reference in New Issue
Block a user