Cleanup, fixed failing build.
This commit is contained in:
parent
5d09053327
commit
7f60f9de5a
3 changed files with 10 additions and 3 deletions
|
|
@ -132,6 +132,8 @@ public class TorrentDownloadRaceTests : IAsyncLifetime
|
|||
|
||||
public Task DisposeAsync()
|
||||
{
|
||||
SqliteConnection.ClearAllPools();
|
||||
|
||||
if (File.Exists(_databasePath))
|
||||
{
|
||||
File.Delete(_databasePath);
|
||||
|
|
@ -160,7 +162,7 @@ public class TorrentDownloadRaceTests : IAsyncLifetime
|
|||
var torrentId = Guid.NewGuid();
|
||||
|
||||
await using var context = CreateContext();
|
||||
context.Torrents.Add(new Torrent
|
||||
context.Torrents.Add(new()
|
||||
{
|
||||
TorrentId = torrentId,
|
||||
Hash = Guid.NewGuid().ToString("N"),
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ using System.IO.Abstractions;
|
|||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
using Microsoft.Extensions.Logging;
|
||||
|
|
@ -37,6 +38,11 @@ public class Torrents(
|
|||
|
||||
private static readonly SemaphoreSlim TorrentResetLock = new(1, 1);
|
||||
|
||||
private static readonly JsonSerializerOptions JsonSerializerOptions = new()
|
||||
{
|
||||
ReferenceHandler = ReferenceHandler.IgnoreCycles
|
||||
};
|
||||
|
||||
private IDebridClient DebridClient
|
||||
{
|
||||
get
|
||||
|
|
@ -609,7 +615,6 @@ public class Torrents(
|
|||
return unrestrictedLink;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public async Task<String> RetrieveFileName(Guid downloadId)
|
||||
{
|
||||
var download = await downloads.GetById(downloadId) ?? throw new($"Download with ID {downloadId} not found");
|
||||
|
|
|
|||
|
|
@ -388,7 +388,7 @@ public class TorrentsController(ILogger<TorrentsController> logger, Torrents tor
|
|||
private static async Task<Byte[]> ReadFormFileBytes(IFormFile file)
|
||||
{
|
||||
await using var fileStream = file.OpenReadStream();
|
||||
await using var memoryStream = file.Length > 0 && file.Length <= Int32.MaxValue ? new MemoryStream((Int32)file.Length) : new MemoryStream();
|
||||
await using var memoryStream = file.Length is > 0 and <= Int32.MaxValue ? new((Int32)file.Length) : new MemoryStream();
|
||||
|
||||
await fileStream.CopyToAsync(memoryStream);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue