1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-27 22:57:09 -04:00

Fixed: Prevent series from being added with an invalid Profile ID

Closes #977
This commit is contained in:
Mark McDowall
2015-12-05 02:22:22 -08:00
parent dc176a83b3
commit d514699ab7
5 changed files with 42 additions and 4 deletions
@@ -5,7 +5,7 @@ namespace NzbDrone.Core.Profiles
{
public interface IProfileRepository : IBasicRepository<Profile>
{
bool Exists(int id);
}
public class ProfileRepository : BasicRepository<Profile>, IProfileRepository
@@ -14,5 +14,10 @@ namespace NzbDrone.Core.Profiles
: base(database, eventAggregator)
{
}
public bool Exists(int id)
{
return DataMapper.Query<Profile>().Where(p => p.Id == id).GetRowCount() == 1;
}
}
}