|
|
|
@ -1,10 +1,10 @@
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using NLog;
|
|
|
|
|
using NzbDrone.Core.Lifecycle;
|
|
|
|
|
using NzbDrone.Core.Messaging.Events;
|
|
|
|
|
using NzbDrone.Core.Languages;
|
|
|
|
|
using NzbDrone.Core.Tv;
|
|
|
|
|
using NzbDrone.Core.Music;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Profiles.Languages
|
|
|
|
|
{
|
|
|
|
@ -21,13 +21,13 @@ namespace NzbDrone.Core.Profiles.Languages
|
|
|
|
|
public class LanguageProfileService : ILanguageProfileService, IHandle<ApplicationStartedEvent>
|
|
|
|
|
{
|
|
|
|
|
private readonly ILanguageProfileRepository _profileRepository;
|
|
|
|
|
private readonly ISeriesService _seriesService;
|
|
|
|
|
private readonly IArtistService _artistService;
|
|
|
|
|
private readonly Logger _logger;
|
|
|
|
|
|
|
|
|
|
public LanguageProfileService(ILanguageProfileRepository profileRepository, ISeriesService seriesService, Logger logger)
|
|
|
|
|
public LanguageProfileService(ILanguageProfileRepository profileRepository, IArtistService artistService, Logger logger)
|
|
|
|
|
{
|
|
|
|
|
_profileRepository = profileRepository;
|
|
|
|
|
_seriesService = seriesService;
|
|
|
|
|
_artistService = artistService;
|
|
|
|
|
_logger = logger;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -43,7 +43,7 @@ namespace NzbDrone.Core.Profiles.Languages
|
|
|
|
|
|
|
|
|
|
public void Delete(int id)
|
|
|
|
|
{
|
|
|
|
|
if (_seriesService.GetAllSeries().Any(c => c.LanguageProfileId == id))
|
|
|
|
|
if (_artistService.GetAllArtists().Any(c => c.LanguageProfileId == id))
|
|
|
|
|
{
|
|
|
|
|
throw new LanguageProfileInUseException(id);
|
|
|
|
|
}
|
|
|
|
@ -92,4 +92,4 @@ namespace NzbDrone.Core.Profiles.Languages
|
|
|
|
|
AddDefaultProfile("English", Language.English, Language.English);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|