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;
|
|
|
|
|
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-02-03 01:07:36 +00:00
|
|
|
|
[SubSonicPrimaryKey(true)]
|
|
|
|
|
public int ProfileId { get; set; }
|
2011-02-06 02:52:49 +00:00
|
|
|
|
|
2011-02-05 18:27:14 +00:00
|
|
|
|
[DisplayName("Name")]
|
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")]
|
|
|
|
|
public string AllowedString { get; set; }
|
|
|
|
|
|
|
|
|
|
[DisplayName("Cutoff")]
|
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;
|
|
|
|
|
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));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2010-09-29 17:19:18 +00:00
|
|
|
|
}
|
|
|
|
|
}
|