Add torrent client integration and downloads management: introduce qbittorrent service in Docker setup, implement downloads endpoint in API, and enhance media storage to handle imported files. Update frontend routes and translations for downloads management.
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
namespace TeleWave.Application.Media.Downloads;
|
||||
|
||||
public sealed record DownloadFileDto(string RelativePath, string Name, long SizeBytes);
|
||||
@@ -0,0 +1,5 @@
|
||||
using LiteCqrs;
|
||||
|
||||
namespace TeleWave.Application.Media.Downloads;
|
||||
|
||||
public sealed record ListDownloadsQuery : IQuery<IReadOnlyList<DownloadFileDto>>;
|
||||
@@ -0,0 +1,20 @@
|
||||
using LiteCqrs;
|
||||
using TeleWave.Application.Common.Interfaces;
|
||||
|
||||
namespace TeleWave.Application.Media.Downloads;
|
||||
|
||||
public sealed class ListDownloadsQueryHandler(IMediaStorage storage)
|
||||
: IQueryHandler<ListDownloadsQuery, IReadOnlyList<DownloadFileDto>>
|
||||
{
|
||||
public Task<IReadOnlyList<DownloadFileDto>> Handle(
|
||||
ListDownloadsQuery query,
|
||||
CancellationToken cancellationToken
|
||||
)
|
||||
{
|
||||
IReadOnlyList<DownloadFileDto> files = storage
|
||||
.ListDownloads()
|
||||
.Select(d => new DownloadFileDto(d.RelativePath, d.Name, d.SizeBytes))
|
||||
.ToList();
|
||||
return Task.FromResult(files);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user