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

31 lines
825 B
C#
Raw Normal View History

2013-03-24 05:16:00 +01:00
using System.Data;
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
{
2013-03-25 04:51:32 +01:00
public SceneMappingRepository(IDatabase database)
2013-03-24 05:16:00 +01:00
: base(database)
2013-03-02 19:25:39 +01:00
{
}
public SceneMapping FindByTvdbId(int tvdbId)
{
2013-03-27 04:44:52 +01:00
return Query.SingleOrDefault(c => c.TvdbId == tvdbId);
2013-03-02 19:25:39 +01:00
}
public SceneMapping FindByCleanTitle(string cleanTitle)
{
2013-03-27 04:44:52 +01:00
return Query.SingleOrDefault(c => c.CleanTitle == cleanTitle);
2013-03-02 19:25:39 +01:00
}
}
}