2010-09-29 17:19:18 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2010-09-30 06:59:00 +00:00
|
|
|
|
using System.ComponentModel;
|
2011-02-11 01:22:29 +00:00
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
2010-09-30 06:59:00 +00:00
|
|
|
|
using SubSonic.SqlGeneration.Schema;
|
2010-09-29 17:19:18 +00:00
|
|
|
|
|
2010-10-21 01:49:23 +00:00
|
|
|
|
namespace NzbDrone.Core.Repository.Quality
|
2010-09-29 17:19:18 +00:00
|
|
|
|
{
|
|
|
|
|
public class QualityProfile
|
|
|
|
|
{
|
2011-04-06 03:14:43 +00:00
|
|
|
|
[SubSonicPrimaryKey]
|
2011-03-31 01:42:27 +00:00
|
|
|
|
public virtual int QualityProfileId { get; set; }
|
2011-02-06 02:52:49 +00:00
|
|
|
|
|
2011-02-16 08:16:14 +00:00
|
|
|
|
[Required(ErrorMessage = "A Name is Required")]
|
2011-02-05 18:27:14 +00:00
|
|
|
|
[DisplayName("Name")]
|
2011-02-15 01:20:17 +00:00
|
|
|
|
[DisplayFormat(ConvertEmptyStringToNull = false)]
|
2011-02-03 01:07:36 +00:00
|
|
|
|
public string Name { get; set; }
|
|
|
|
|
public bool UserProfile { get; set; } //Allows us to tell the difference between default and user profiles
|
2010-09-30 06:59:00 +00:00
|
|
|
|
|
2011-02-03 20:09:19 +00:00
|
|
|
|
[SubSonicIgnore]
|
2011-02-05 18:27:14 +00:00
|
|
|
|
[DisplayName("Allowed Qualities")]
|
2011-02-03 19:47:51 +00:00
|
|
|
|
public List<QualityTypes> Allowed { get; set; }
|
|
|
|
|
|
2011-02-06 02:52:49 +00:00
|
|
|
|
[SubSonicIgnore]
|
|
|
|
|
[DisplayName("Allowed Qualities String")]
|
2011-02-15 01:20:17 +00:00
|
|
|
|
[DisplayFormat(ConvertEmptyStringToNull = false)]
|
2011-02-06 02:52:49 +00:00
|
|
|
|
public string AllowedString { get; set; }
|
|
|
|
|
|
2011-03-31 01:42:27 +00:00
|
|
|
|
[DisplayName("Cut-off")]
|
|
|
|
|
[Required(ErrorMessage = "Valid Cut-off is Required")]
|
2011-02-03 20:09:19 +00:00
|
|
|
|
public QualityTypes Cutoff { get; set; }
|
2010-09-30 06:59:00 +00:00
|
|
|
|
|
2011-02-03 20:09:19 +00:00
|
|
|
|
[EditorBrowsable(EditorBrowsableState.Never)]
|
|
|
|
|
public string SonicAllowed
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
string result = String.Empty;
|
2011-04-05 05:30:13 +00:00
|
|
|
|
if (Allowed == null) return result;
|
|
|
|
|
|
2011-02-03 20:09:19 +00:00
|
|
|
|
foreach (var q in Allowed)
|
|
|
|
|
{
|
|
|
|
|
result += (int)q + "|";
|
|
|
|
|
}
|
|
|
|
|
return result.Trim('|');
|
|
|
|
|
}
|
|
|
|
|
private set
|
|
|
|
|
{
|
|
|
|
|
var qualities = value.Split('|');
|
|
|
|
|
Allowed = new List<QualityTypes>(qualities.Length);
|
|
|
|
|
foreach (var quality in qualities)
|
|
|
|
|
{
|
|
|
|
|
Allowed.Add((QualityTypes)Convert.ToInt32(quality));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2011-02-16 08:16:14 +00:00
|
|
|
|
|
|
|
|
|
[SubSonicToManyRelation]
|
|
|
|
|
public virtual List<string> Series { get; private set; }
|
2010-09-29 17:19:18 +00:00
|
|
|
|
}
|
|
|
|
|
}
|