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

40 lines
1.0 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
{
public int Id { get; set; }
public QualityTypes 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<QualityTypes>(qualities.Length);
2010-09-30 06:59:00 +00:00
foreach (var quality in qualities)
{
Allowed.Add((QualityTypes)Convert.ToInt32(quality));
2010-09-30 06:59:00 +00:00
}
}
}
[SubSonicIgnore]
public List<QualityTypes> Allowed { get; set; }
2010-09-29 17:19:18 +00:00
}
}