mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 14:03:29 -07:00
QualityProfiles edit via backbone
This commit is contained in:
parent
bc424709af
commit
79902194df
8 changed files with 130 additions and 31 deletions
27
NzbDrone.Api/Resolvers/QualitiesToAllowedResolver.cs
Normal file
27
NzbDrone.Api/Resolvers/QualitiesToAllowedResolver.cs
Normal file
|
@ -0,0 +1,27 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using AutoMapper;
|
||||
using NzbDrone.Api.QualityProfiles;
|
||||
using NzbDrone.Core.Repository.Quality;
|
||||
|
||||
namespace NzbDrone.Api.Resolvers
|
||||
{
|
||||
public class QualitiesToAllowedResolver : ValueResolver<List<QualityProfileType>, List<QualityTypes>>
|
||||
{
|
||||
protected override List<QualityTypes> ResolveCore(List<QualityProfileType> source)
|
||||
{
|
||||
var ids = source.Where(s => s.Allowed).Select(s => s.Id).ToList();
|
||||
|
||||
var qualityTypes = new List<QualityTypes>();
|
||||
|
||||
ids.ForEach(id =>
|
||||
{
|
||||
qualityTypes.Add(QualityTypes.FindById(id));
|
||||
});
|
||||
|
||||
return qualityTypes;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue