mirror of
https://github.com/Radarr/Radarr
synced 2024-12-27 02:09:59 +00:00
28 lines
791 B
C#
28 lines
791 B
C#
|
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;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|