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:
Leonid Pershin
2026-07-24 16:42:14 +03:00
parent 5853009d71
commit e7840ba919
18 changed files with 382 additions and 6 deletions
@@ -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);
}
}