run dotnet format

This commit is contained in:
Cucumberrbob 2025-03-16 15:34:25 +00:00
parent afc7d1a964
commit 93fac23128
No known key found for this signature in database
GPG key ID: 2B935C47401C3614
2 changed files with 12 additions and 10 deletions

View file

@ -322,12 +322,14 @@ public class TorBoxTorrentClient(ILogger<TorBoxTorrentClient> logger, IHttpClien
{ {
return fileName.Trim('"'); return fileName.Trim('"');
} }
} else }
else
{ {
if (response.Content.Headers.ContentType?.MediaType == "application/zip") if (response.Content.Headers.ContentType?.MediaType == "application/zip")
{ {
return $"download-{new Random().Next(1, 10001)}.zip"; return $"download-{new Random().Next(1, 10001)}.zip";
} else }
else
{ {
logger.LogDebug($"Failed to get filename for URI {downloadUrl}"); logger.LogDebug($"Failed to get filename for URI {downloadUrl}");
} }
@ -353,7 +355,7 @@ public class TorBoxTorrentClient(ILogger<TorBoxTorrentClient> logger, IHttpClien
return Map(result!); return Map(result!);
} }
public static void MoveHashDirContents(String extractPath, Torrent _torrent) public static void MoveHashDirContents(String extractPath, Torrent _torrent)
{ {
var hashDir = Path.Combine(extractPath, _torrent.Hash); var hashDir = Path.Combine(extractPath, _torrent.Hash);

View file

@ -11,13 +11,13 @@ namespace RdtClient.Service.Services;
public class UnpackClient(Download download, String destinationPath) public class UnpackClient(Download download, String destinationPath)
{ {
public Boolean Finished { get; private set; } public Boolean Finished { get; private set; }
public String? Error { get; private set; } public String? Error { get; private set; }
public Int32 Progess { get; private set; } public Int32 Progess { get; private set; }
private readonly Torrent _torrent = download.Torrent ?? throw new($"Torrent is null"); private readonly Torrent _torrent = download.Torrent ?? throw new($"Torrent is null");
private readonly CancellationTokenSource _cancellationTokenSource = new(); private readonly CancellationTokenSource _cancellationTokenSource = new();
public void Start() public void Start()
@ -70,13 +70,13 @@ public class UnpackClient(Download download, String destinationPath)
if (archiveEntries.Any(m => m.Contains(".r00"))) if (archiveEntries.Any(m => m.Contains(".r00")))
{ {
extractPathTemp = Path.Combine(extractPath, Guid.NewGuid().ToString()); extractPathTemp = Path.Combine(extractPath, Guid.NewGuid().ToString());
if (!Directory.Exists(extractPathTemp)) if (!Directory.Exists(extractPathTemp))
{ {
Directory.CreateDirectory(extractPathTemp); Directory.CreateDirectory(extractPathTemp);
} }
} }
if (extractPathTemp != null) if (extractPathTemp != null)
{ {
Extract(filePath, extractPathTemp, cancellationToken); Extract(filePath, extractPathTemp, cancellationToken);
@ -168,10 +168,10 @@ public class UnpackClient(Download download, String destinationPath)
d => d =>
{ {
Debug.WriteLine(d); Debug.WriteLine(d);
Progess = (Int32) Math.Round(d); Progess = (Int32)Math.Round(d);
}, },
cancellationToken: cancellationToken); cancellationToken: cancellationToken);
archive.Dispose(); archive.Dispose();
GC.Collect(); GC.Collect();