mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
Store QualityPofile properly
This commit is contained in:
parent
e9b9e63f7a
commit
b6ac7638a1
9 changed files with 80 additions and 10 deletions
|
@ -1,4 +1,6 @@
|
|||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using NzbDrone.Core.Datastore;
|
||||
|
||||
|
@ -8,6 +10,32 @@ 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; }
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue