Refactor AdminContentProvider

This commit is contained in:
2023-08-24 10:37:04 +02:00
parent 5c62419f65
commit c2668d7270
27 changed files with 132 additions and 161 deletions

View File

@@ -1,17 +1,20 @@
using FileTime.Core.Models;
using FileTime.Server.Common;
using FileTime.Core.ContentAccess;
using FileTime.Core.Models;
using InitableService;
namespace FileTime.Providers.Remote;
public class RemoteItemDeleter : IRemoteItemDeleter
public class RemoteItemDeleter : IItemDeleter<IRemoteContentProvider>, IInitable<IRemoteContentProvider, string>
{
private IRemoteConnection _remoteConnection = null!;
private IRemoteContentProvider _remoteContentProvider = null!;
private string _remoteContentProviderId = null!;
public void Init(IRemoteConnection remoteConnection, string remoteContentProviderId)
public void Init(IRemoteContentProvider remoteConnection, string remoteContentProviderId)
{
_remoteConnection = remoteConnection;
_remoteContentProvider = remoteConnection;
_remoteContentProviderId = remoteContentProviderId;
}
public async Task DeleteAsync(IRemoteContentProvider contentProvider, FullName fullName)
=> await _remoteConnection.DeleteItemAsync(_remoteContentProviderId, fullName);
public async Task DeleteAsync(IRemoteContentProvider contentProvider, FullName fullName)
=> await (await _remoteContentProvider.GetRemoteConnectionAsync()).DeleteItemAsync(_remoteContentProviderId, fullName);
}