mirror of
https://github.com/Cleanuparr/Cleanuparr.git
synced 2025-12-30 09:28:22 -05:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a064a22bd | ||
|
|
ee764ff215 | ||
|
|
402677b69b |
@@ -13,4 +13,6 @@ public sealed record UpdateQueueCleanerConfigRequest
|
||||
public FailedImportConfig FailedImport { get; init; } = new();
|
||||
|
||||
public ushort DownloadingMetadataMaxStrikes { get; init; }
|
||||
|
||||
public List<string> IgnoredDownloads { get; set; } = [];
|
||||
}
|
||||
|
||||
@@ -69,6 +69,7 @@ public sealed class QueueCleanerConfigController : ControllerBase
|
||||
oldConfig.UseAdvancedScheduling = newConfigDto.UseAdvancedScheduling;
|
||||
oldConfig.FailedImport = newConfigDto.FailedImport;
|
||||
oldConfig.DownloadingMetadataMaxStrikes = newConfigDto.DownloadingMetadataMaxStrikes;
|
||||
oldConfig.IgnoredDownloads = newConfigDto.IgnoredDownloads;
|
||||
|
||||
await _dataContext.SaveChangesAsync();
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ public sealed class TransmissionItem : ITorrentItem
|
||||
// State checking methods
|
||||
// Transmission status: 0=stopped, 1=check pending, 2=checking, 3=download pending, 4=downloading, 5=seed pending, 6=seeding
|
||||
public bool IsDownloading() => _torrentInfo.Status == 4;
|
||||
public bool IsStalled() => _torrentInfo.Status == 4 && (_torrentInfo.RateDownload ?? 0) == 0 && (_torrentInfo.Eta ?? 0) == 0;
|
||||
public bool IsStalled() => _torrentInfo is { Status: 4, RateDownload: <= 0, Eta: <= 0 };
|
||||
public bool IsSeeding() => _torrentInfo.Status == 6;
|
||||
public bool IsCompleted() => CompletionPercentage >= 100.0;
|
||||
public bool IsPaused() => _torrentInfo.Status == 0;
|
||||
|
||||
@@ -22,7 +22,6 @@ public sealed class AppStatusRefreshService : BackgroundService
|
||||
private static readonly Uri StatusUri = new("https://cleanuparr-status.pages.dev/status.json");
|
||||
private static readonly TimeSpan PollInterval = TimeSpan.FromMinutes(10);
|
||||
private static readonly TimeSpan StartupDelay = TimeSpan.FromSeconds(5);
|
||||
private static readonly TimeSpan RequestTimeout = TimeSpan.FromSeconds(3);
|
||||
|
||||
public AppStatusRefreshService(
|
||||
ILogger<AppStatusRefreshService> logger,
|
||||
@@ -70,7 +69,6 @@ public sealed class AppStatusRefreshService : BackgroundService
|
||||
try
|
||||
{
|
||||
using var client = _httpClientFactory.CreateClient(Constants.HttpClientWithRetryName);
|
||||
client.Timeout = RequestTimeout;
|
||||
|
||||
using var response = await client.GetAsync(StatusUri, cancellationToken);
|
||||
response.EnsureSuccessStatusCode();
|
||||
|
||||
Reference in New Issue
Block a user