mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 18:57:39 -07:00
Added Quality Provider to interface with QualityProfiles.
Changed QualityProfile and AllowedQuality to be meet requirements
This commit is contained in:
parent
9eaec6a2e9
commit
3b63cfb5d2
5 changed files with 112 additions and 26 deletions
|
@ -1,4 +1,6 @@
|
|||
namespace NzbDrone.Core.Repository.Quality
|
||||
using SubSonic.SqlGeneration.Schema;
|
||||
|
||||
namespace NzbDrone.Core.Repository.Quality
|
||||
{
|
||||
public class AllowedQuality
|
||||
{
|
||||
|
@ -7,5 +9,8 @@
|
|||
public int Order { get; set; }
|
||||
public bool MarkComplete { get; set; }
|
||||
public QualityTypes Quality { get; set; }
|
||||
|
||||
[SubSonicToOneRelation(ThisClassContainsJoinKey = true)]
|
||||
public virtual QualityProfile QualityProfile { get; private set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,33 +7,15 @@ namespace NzbDrone.Core.Repository.Quality
|
|||
{
|
||||
public class QualityProfile
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public QualityTypes Cutoff { get; set; }
|
||||
[SubSonicPrimaryKey(true)]
|
||||
public int ProfileId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public bool UserProfile { get; set; } //Allows us to tell the difference between default and user profiles
|
||||
|
||||
[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));
|
||||
}
|
||||
}
|
||||
}
|
||||
[SubSonicToManyRelation]
|
||||
public virtual List<AllowedQuality> Allowed { get; private set; }
|
||||
|
||||
[SubSonicIgnore]
|
||||
public List<QualityTypes> Allowed { get; set; }
|
||||
public List<AllowedQuality> AllowedQualities { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue