1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-29 03:15:19 +00:00
Radarr/NzbDrone.Core/Qualities/QualityProfile.cs

41 lines
1.1 KiB
C#
Raw Normal View History

2013-03-26 08:02:31 +00:00
using System;
using System.Collections.Generic;
using System.ComponentModel;
2013-02-27 03:19:22 +00:00
using System.Linq;
using NzbDrone.Core.Datastore;
namespace NzbDrone.Core.Qualities
{
public class QualityProfile : ModelBase
{
public string Name { get; set; }
public List<Quality> Allowed { get; set; }
2013-03-26 08:02:31 +00:00
[EditorBrowsable(EditorBrowsableState.Never)]
public string DbAllowed
{
get
{
string result = String.Empty;
if (Allowed == null) return result;
foreach (var q in Allowed)
{
result += q.Id + "|";
}
return result.Trim('|');
}
private set
{
var qualities = value.Split('|');
Allowed = new List<Quality>(qualities.Length);
foreach (var quality in qualities.Where(q => !String.IsNullOrWhiteSpace(q)))
{
Allowed.Add(Quality.FindById(Convert.ToInt32(quality)));
}
}
}
2013-02-27 03:19:22 +00:00
public Quality Cutoff { get; set; }
}
}