Add sorting and filters for Seeker stats (#576)

This commit is contained in:
Flaminel
2026-04-25 11:57:38 +03:00
committed by GitHub
parent 41ca55d615
commit 02a07d4fa3
56 changed files with 4284 additions and 333 deletions

View File

@@ -0,0 +1,23 @@
using System.Text.Json.Serialization;
namespace Cleanuparr.Domain.Enums;
/// <summary>
/// Sorting fields available for custom format score listings.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum CfScoresSortBy
{
/// <summary>Sort by item title.</summary>
Title,
/// <summary>Sort by the item's current custom format score.</summary>
CurrentScore,
/// <summary>Sort by the quality profile's configured cutoff score.</summary>
CutoffScore,
/// <summary>Sort by quality profile name.</summary>
QualityProfile,
/// <summary>Sort by the timestamp of the last score sync.</summary>
LastSyncedAt,
/// <summary>Sort by the timestamp of the most recent score upgrade.</summary>
LastUpgradedAt,
}

View File

@@ -0,0 +1,23 @@
using System.Text.Json.Serialization;
namespace Cleanuparr.Domain.Enums;
/// <summary>
/// Sorting fields available for custom format score upgrades.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum CfUpgradesSortBy
{
/// <summary>Sort by the timestamp at which the upgrade was recorded.</summary>
UpgradedAt,
/// <summary>Sort by item title.</summary>
Title,
/// <summary>Sort by the score recorded after the upgrade.</summary>
NewScore,
/// <summary>Sort by the score recorded immediately before the upgrade.</summary>
PreviousScore,
/// <summary>Sort by the difference between the new and previous scores.</summary>
ScoreDelta,
/// <summary>Sort by the quality profile's configured cutoff score.</summary>
CutoffScore,
}

View File

@@ -0,0 +1,17 @@
using System.Text.Json.Serialization;
namespace Cleanuparr.Domain.Enums;
/// <summary>
/// Filters custom format score rows by their relation to the configured quality cutoff.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum CutoffFilter
{
/// <summary>Include all items regardless of cutoff status.</summary>
All,
/// <summary>Include only items whose current score is below the cutoff.</summary>
Below,
/// <summary>Include only items whose current score meets or exceeds the cutoff.</summary>
Met,
}

View File

@@ -0,0 +1,17 @@
using System.Text.Json.Serialization;
namespace Cleanuparr.Domain.Enums;
/// <summary>
/// Filters items by their monitored state in the source *arr application.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum MonitoredFilter
{
/// <summary>Include both monitored and unmonitored items.</summary>
All,
/// <summary>Include only monitored items.</summary>
Monitored,
/// <summary>Include only unmonitored items.</summary>
Unmonitored,
}

View File

@@ -0,0 +1,19 @@
using System.Text.Json.Serialization;
namespace Cleanuparr.Domain.Enums;
/// <summary>
/// Sorting fields available for search event listings.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum SearchEventsSortBy
{
/// <summary>Sort by the event timestamp.</summary>
Timestamp,
/// <summary>Sort by the item title associated with the search.</summary>
Title,
/// <summary>Sort by the search command status.</summary>
Status,
/// <summary>Sort by the search type (proactive, replacement, etc.).</summary>
Type,
}

View File

@@ -0,0 +1,15 @@
using System.Text.Json.Serialization;
namespace Cleanuparr.Domain.Enums;
/// <summary>
/// Direction used when ordering a result set.
/// </summary>
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum SortDirection
{
/// <summary>Ascending order.</summary>
Asc,
/// <summary>Descending order.</summary>
Desc,
}