2013-03-04 21:20:47 -08:00
|
|
|
using System;
|
2011-08-21 17:48:37 -07:00
|
|
|
|
2013-03-04 21:37:33 -08:00
|
|
|
namespace NzbDrone.Core.Jobs
|
2011-08-21 17:48:37 -07:00
|
|
|
{
|
|
|
|
public class JobQueueItem : IEquatable<JobQueueItem>
|
|
|
|
{
|
|
|
|
public Type JobType { get; set; }
|
2012-09-10 12:04:17 -07:00
|
|
|
public dynamic Options { get; set; }
|
2011-08-21 17:48:37 -07:00
|
|
|
|
2012-02-26 14:35:45 -08:00
|
|
|
public JobSourceType Source { get; set; }
|
|
|
|
|
2011-08-21 17:48:37 -07:00
|
|
|
public bool Equals(JobQueueItem other)
|
|
|
|
{
|
2012-09-10 12:04:17 -07:00
|
|
|
return (JobType == other.JobType && Options == other.Options);
|
2011-11-06 22:26:21 -08:00
|
|
|
}
|
2011-08-21 17:48:37 -07:00
|
|
|
|
2011-11-06 22:26:21 -08:00
|
|
|
public override string ToString()
|
|
|
|
{
|
2013-04-22 00:21:39 -07:00
|
|
|
if (Options != null)
|
|
|
|
{
|
|
|
|
return string.Format("[{0}({1})]", JobType.Name, Options);
|
|
|
|
}
|
|
|
|
|
|
|
|
return string.Format("[{0}]", JobType.Name);
|
2011-08-21 17:48:37 -07:00
|
|
|
}
|
2012-02-26 14:35:45 -08:00
|
|
|
|
|
|
|
public enum JobSourceType
|
|
|
|
{
|
|
|
|
User,
|
|
|
|
Scheduler
|
|
|
|
}
|
2011-08-21 17:48:37 -07:00
|
|
|
}
|
|
|
|
}
|