mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-24 22:55:21 -04:00
828aea14a9
Co-Authored-By: Mark McDowall <markus101@users.noreply.github.com>
33 lines
681 B
C#
33 lines
681 B
C#
using System.Collections.Generic;
|
|
|
|
namespace NzbDrone.Core.Messaging.Commands
|
|
{
|
|
public class CommandPriorityComparer : IComparer<CommandStatus>
|
|
{
|
|
public int Compare(CommandStatus x, CommandStatus y)
|
|
{
|
|
if (x == CommandStatus.Started && y != CommandStatus.Started)
|
|
{
|
|
return -1;
|
|
}
|
|
|
|
if (x != CommandStatus.Started && y == CommandStatus.Started)
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
if (x < y)
|
|
{
|
|
return -1;
|
|
}
|
|
|
|
if (x > y)
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
}
|
|
}
|