When doing a `sync --preview`, new custom formats are not created and thus they never get an ID greater than `0`. Because of this, a dictionary that tracks duplicates based on ID would result in warnings about duplicate scores that made no sense. We now index by Trash ID instead of Format ID, which is more accurate.pull/201/head
parent
018d5f0157
commit
fe7773ea07
@ -1,13 +1,42 @@
|
||||
using Recyclarr.Cli.Pipelines.QualityProfile.Api;
|
||||
|
||||
namespace Recyclarr.Cli.Pipelines.QualityProfile;
|
||||
|
||||
public enum FormatScoreUpdateReason
|
||||
{
|
||||
/// <summary>
|
||||
/// A score who's value did not change.
|
||||
/// </summary>
|
||||
NoChange,
|
||||
|
||||
/// <summary>
|
||||
/// A score that is changed.
|
||||
/// </summary>
|
||||
Updated,
|
||||
Reset
|
||||
|
||||
/// <summary>
|
||||
/// Scores were reset to a 0 value because `reset_unmatched_scores` was set to `true`.
|
||||
/// </summary>
|
||||
Reset,
|
||||
|
||||
/// <summary>
|
||||
/// New custom format scores (format items) shouldn't exist normally. They do exist during
|
||||
/// `--preview` runs since new custom formats that aren't synced yet won't be available when
|
||||
/// processing quality profiles.
|
||||
/// </summary>
|
||||
New
|
||||
}
|
||||
|
||||
public record UpdatedFormatScore(
|
||||
string CustomFormatName,
|
||||
int OldScore,
|
||||
int NewScore,
|
||||
FormatScoreUpdateReason Reason);
|
||||
public record UpdatedFormatScore
|
||||
{
|
||||
public required ProfileFormatItemDto Dto { get; init; }
|
||||
public required int NewScore { get; init; }
|
||||
public required FormatScoreUpdateReason Reason { get; init; }
|
||||
|
||||
public void Deconstruct(out ProfileFormatItemDto dto, out int newScore, out FormatScoreUpdateReason reason)
|
||||
{
|
||||
dto = Dto;
|
||||
newScore = NewScore;
|
||||
reason = Reason;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in new issue