1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-09 12:32:31 +01:00
Radarr/NzbDrone.Core/ReferenceData/SceneMappingRepository.cs

30 lines
832 B
C#
Raw Normal View History

2013-03-02 19:25:39 +01:00
using System.Linq;
using NzbDrone.Core.Datastore;
namespace NzbDrone.Core.ReferenceData
{
public interface ISceneMappingRepository : IBasicRepository<SceneMapping>
{
SceneMapping FindByTvdbId(int tvdbId);
SceneMapping FindByCleanTitle(string cleanTitle);
}
public class SceneMappingRepository : BasicRepository<SceneMapping>, ISceneMappingRepository
{
public SceneMappingRepository(IObjectDatabase objectDatabase)
: base(objectDatabase)
{
}
public SceneMapping FindByTvdbId(int tvdbId)
{
return Queryable.SingleOrDefault(c => c.TvdbId == tvdbId);
}
public SceneMapping FindByCleanTitle(string cleanTitle)
{
return Queryable.SingleOrDefault(c => c.CleanTitle == cleanTitle);
}
}
}