1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2025-03-12 23:27:26 +00:00
Radarr/NzbDrone.Core/ReferenceData/SceneMappingRepository.cs

31 lines
837 B
C#
Raw Normal View History

2013-03-23 21:16:00 -07:00
using System.Data;
2013-03-02 10:25:39 -08: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
{
2013-03-24 20:51:32 -07:00
public SceneMappingRepository(IDatabase database)
2013-03-23 21:16:00 -07:00
: base(database)
2013-03-02 10:25:39 -08:00
{
}
public SceneMapping FindByTvdbId(int tvdbId)
{
2013-03-24 20:51:32 -07:00
return Queryable().SingleOrDefault(c => c.TvdbId == tvdbId);
2013-03-02 10:25:39 -08:00
}
public SceneMapping FindByCleanTitle(string cleanTitle)
{
2013-03-24 20:51:32 -07:00
return Queryable().SingleOrDefault(c => c.CleanTitle == cleanTitle);
2013-03-02 10:25:39 -08:00
}
}
}