|
|
@ -7,6 +7,7 @@ using NzbDrone.Core.Notifications;
|
|
|
|
using NzbDrone.Core.Profiles.Delay;
|
|
|
|
using NzbDrone.Core.Profiles.Delay;
|
|
|
|
using NzbDrone.Core.Restrictions;
|
|
|
|
using NzbDrone.Core.Restrictions;
|
|
|
|
using NzbDrone.Core.Movies;
|
|
|
|
using NzbDrone.Core.Movies;
|
|
|
|
|
|
|
|
using NzbDrone.Core.NetImport;
|
|
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Tags
|
|
|
|
namespace NzbDrone.Core.Tags
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -28,6 +29,7 @@ namespace NzbDrone.Core.Tags
|
|
|
|
private readonly ITagRepository _repo;
|
|
|
|
private readonly ITagRepository _repo;
|
|
|
|
private readonly IEventAggregator _eventAggregator;
|
|
|
|
private readonly IEventAggregator _eventAggregator;
|
|
|
|
private readonly IDelayProfileService _delayProfileService;
|
|
|
|
private readonly IDelayProfileService _delayProfileService;
|
|
|
|
|
|
|
|
private readonly INetImportFactory _netImportFactory;
|
|
|
|
private readonly INotificationFactory _notificationFactory;
|
|
|
|
private readonly INotificationFactory _notificationFactory;
|
|
|
|
private readonly IRestrictionService _restrictionService;
|
|
|
|
private readonly IRestrictionService _restrictionService;
|
|
|
|
private readonly IMovieService _movieService;
|
|
|
|
private readonly IMovieService _movieService;
|
|
|
@ -35,6 +37,7 @@ namespace NzbDrone.Core.Tags
|
|
|
|
public TagService(ITagRepository repo,
|
|
|
|
public TagService(ITagRepository repo,
|
|
|
|
IEventAggregator eventAggregator,
|
|
|
|
IEventAggregator eventAggregator,
|
|
|
|
IDelayProfileService delayProfileService,
|
|
|
|
IDelayProfileService delayProfileService,
|
|
|
|
|
|
|
|
INetImportFactory netImportFactory,
|
|
|
|
INotificationFactory notificationFactory,
|
|
|
|
INotificationFactory notificationFactory,
|
|
|
|
IRestrictionService restrictionService,
|
|
|
|
IRestrictionService restrictionService,
|
|
|
|
IMovieService movieService)
|
|
|
|
IMovieService movieService)
|
|
|
@ -42,6 +45,7 @@ namespace NzbDrone.Core.Tags
|
|
|
|
_repo = repo;
|
|
|
|
_repo = repo;
|
|
|
|
_eventAggregator = eventAggregator;
|
|
|
|
_eventAggregator = eventAggregator;
|
|
|
|
_delayProfileService = delayProfileService;
|
|
|
|
_delayProfileService = delayProfileService;
|
|
|
|
|
|
|
|
_netImportFactory = netImportFactory;
|
|
|
|
_notificationFactory = notificationFactory;
|
|
|
|
_notificationFactory = notificationFactory;
|
|
|
|
_restrictionService = restrictionService;
|
|
|
|
_restrictionService = restrictionService;
|
|
|
|
_movieService = movieService;
|
|
|
|
_movieService = movieService;
|
|
|
@ -73,6 +77,7 @@ namespace NzbDrone.Core.Tags
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var tag = GetTag(tagId);
|
|
|
|
var tag = GetTag(tagId);
|
|
|
|
var delayProfiles = _delayProfileService.AllForTag(tagId);
|
|
|
|
var delayProfiles = _delayProfileService.AllForTag(tagId);
|
|
|
|
|
|
|
|
var netImports = _netImportFactory.AllForTag(tagId);
|
|
|
|
var notifications = _notificationFactory.AllForTag(tagId);
|
|
|
|
var notifications = _notificationFactory.AllForTag(tagId);
|
|
|
|
var restrictions = _restrictionService.AllForTag(tagId);
|
|
|
|
var restrictions = _restrictionService.AllForTag(tagId);
|
|
|
|
var movies = _movieService.AllForTag(tagId);
|
|
|
|
var movies = _movieService.AllForTag(tagId);
|
|
|
@ -82,6 +87,7 @@ namespace NzbDrone.Core.Tags
|
|
|
|
Id = tagId,
|
|
|
|
Id = tagId,
|
|
|
|
Label = tag.Label,
|
|
|
|
Label = tag.Label,
|
|
|
|
DelayProfileIds = delayProfiles.Select(c => c.Id).ToList(),
|
|
|
|
DelayProfileIds = delayProfiles.Select(c => c.Id).ToList(),
|
|
|
|
|
|
|
|
NetImportIds = netImports.Select(c => c.Id).ToList(),
|
|
|
|
NotificationIds = notifications.Select(c => c.Id).ToList(),
|
|
|
|
NotificationIds = notifications.Select(c => c.Id).ToList(),
|
|
|
|
RestrictionIds = restrictions.Select(c => c.Id).ToList(),
|
|
|
|
RestrictionIds = restrictions.Select(c => c.Id).ToList(),
|
|
|
|
MovieIds = movies.Select(c => c.Id).ToList()
|
|
|
|
MovieIds = movies.Select(c => c.Id).ToList()
|
|
|
@ -92,6 +98,7 @@ namespace NzbDrone.Core.Tags
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var tags = All();
|
|
|
|
var tags = All();
|
|
|
|
var delayProfiles = _delayProfileService.All();
|
|
|
|
var delayProfiles = _delayProfileService.All();
|
|
|
|
|
|
|
|
var netImports = _netImportFactory.All();
|
|
|
|
var notifications = _notificationFactory.All();
|
|
|
|
var notifications = _notificationFactory.All();
|
|
|
|
var restrictions = _restrictionService.All();
|
|
|
|
var restrictions = _restrictionService.All();
|
|
|
|
var movies = _movieService.GetAllMovies();
|
|
|
|
var movies = _movieService.GetAllMovies();
|
|
|
@ -105,6 +112,7 @@ namespace NzbDrone.Core.Tags
|
|
|
|
Id = tag.Id,
|
|
|
|
Id = tag.Id,
|
|
|
|
Label = tag.Label,
|
|
|
|
Label = tag.Label,
|
|
|
|
DelayProfileIds = delayProfiles.Where(c => c.Tags.Contains(tag.Id)).Select(c => c.Id).ToList(),
|
|
|
|
DelayProfileIds = delayProfiles.Where(c => c.Tags.Contains(tag.Id)).Select(c => c.Id).ToList(),
|
|
|
|
|
|
|
|
NetImportIds = netImports.Where(c => c.Tags.Contains(tag.Id)).Select(c => c.Id).ToList(),
|
|
|
|
NotificationIds = notifications.Where(c => c.Tags.Contains(tag.Id)).Select(c => c.Id).ToList(),
|
|
|
|
NotificationIds = notifications.Where(c => c.Tags.Contains(tag.Id)).Select(c => c.Id).ToList(),
|
|
|
|
RestrictionIds = restrictions.Where(c => c.Tags.Contains(tag.Id)).Select(c => c.Id).ToList(),
|
|
|
|
RestrictionIds = restrictions.Where(c => c.Tags.Contains(tag.Id)).Select(c => c.Id).ToList(),
|
|
|
|
MovieIds = movies.Where(c => c.Tags.Contains(tag.Id)).Select(c => c.Id).ToList()
|
|
|
|
MovieIds = movies.Where(c => c.Tags.Contains(tag.Id)).Select(c => c.Id).ToList()
|
|
|
|