From 2eb68655c7bdbf4a094ed0a93b4544607c6ac14b Mon Sep 17 00:00:00 2001 From: Dennis Reimann Date: Mon, 14 Mar 2022 14:11:06 +0100 Subject: [PATCH] FileService: Add method to check availability --- BTCPayServer.Abstractions/Contracts/IFileService.cs | 3 +-- BTCPayServer/Storage/Services/FileService.cs | 6 ++++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/BTCPayServer.Abstractions/Contracts/IFileService.cs b/BTCPayServer.Abstractions/Contracts/IFileService.cs index 25f229fe2..9782aa22c 100644 --- a/BTCPayServer.Abstractions/Contracts/IFileService.cs +++ b/BTCPayServer.Abstractions/Contracts/IFileService.cs @@ -7,11 +7,10 @@ namespace BTCPayServer.Abstractions.Contracts; public interface IFileService { + Task IsAvailable(); Task AddFile(IFormFile file, string userId); Task GetFileUrl(Uri baseUri, string fileId); - Task GetTemporaryFileUrl(Uri baseUri, string fileId, DateTimeOffset expiry, bool isDownload); - Task RemoveFile(string fileId, string userId); } diff --git a/BTCPayServer/Storage/Services/FileService.cs b/BTCPayServer/Storage/Services/FileService.cs index e4ede5ec9..89830f939 100644 --- a/BTCPayServer/Storage/Services/FileService.cs +++ b/BTCPayServer/Storage/Services/FileService.cs @@ -25,6 +25,12 @@ namespace BTCPayServer.Storage.Services _providers = providers; _SettingsRepository = settingsRepository; } + + public async Task IsAvailable() + { + var settings = await _SettingsRepository.GetSettingAsync(); + return settings is not null; + } public async Task AddFile(IFormFile file, string userId) {