sonarr-repo-only/NzbDrone.Core/Repository/QualityProfile.cs

42 lines
1.1 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;
2010-09-29 17:19:18 +00:00
using System.Linq;
using System.Text;
2010-09-30 06:59:00 +00:00
using SubSonic.SqlGeneration.Schema;
2010-09-29 17:19:18 +00:00
namespace NzbDrone.Core.Repository
{
public class QualityProfile
{
public int Id { get; set; }
public Quality Cutoff { get; set; }
2010-09-30 06:59:00 +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<Quality>(qualities.Length);
foreach (var quality in qualities)
{
Allowed.Add((Quality)Convert.ToInt32(quality));
}
}
}
[SubSonicIgnore]
public List<Quality> Allowed { get; set; }
2010-09-29 17:19:18 +00:00
}
}