Sonarr/NzbDrone.Core/Repository/Quality/QualityProfile.cs

52 lines
1.5 KiB
C#
Raw Normal View History

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
namespace NzbDrone.Core.Repository.Quality
2010-09-29 17:19:18 +00:00
{
public class QualityProfile
{
[SubSonicPrimaryKey(true)]
public int ProfileId { get; set; }
[DisplayName("Name")]
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]
[DisplayName("Allowed Qualities")]
public List<QualityTypes> Allowed { get; set; }
[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
}
}