quality Series.QualityProfile is lazyloaded.

This commit is contained in:
kay.one 2013-04-28 18:47:06 -07:00
commit 016e360d1a
16 changed files with 154 additions and 72 deletions

View file

@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Collections.Generic;
using NzbDrone.Core.Datastore;
namespace NzbDrone.Core.Qualities
@ -10,32 +7,6 @@ namespace NzbDrone.Core.Qualities
{
public string Name { get; set; }
public List<Quality> Allowed { get; set; }
[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)));
}
}
}
public Quality Cutoff { get; set; }
}
}