1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/NzbDrone.Core/DataAugmentation/Scene/SceneMappingRepository.cs
2013-05-05 14:24:33 -07:00

31 lines
905 B
C#

using System.Linq;
using NzbDrone.Common.Messaging;
using NzbDrone.Core.Datastore;
namespace NzbDrone.Core.DataAugmentation.Scene
{
public interface ISceneMappingRepository : IBasicRepository<SceneMapping>
{
SceneMapping FindByTvdbId(int tvdbId);
SceneMapping FindByCleanTitle(string cleanTitle);
}
public class SceneMappingRepository : BasicRepository<SceneMapping>, ISceneMappingRepository
{
public SceneMappingRepository(IDatabase database, IMessageAggregator messageAggregator)
: base(database, messageAggregator)
{
}
public SceneMapping FindByTvdbId(int tvdbId)
{
return Query.SingleOrDefault(c => c.TvdbId == tvdbId);
}
public SceneMapping FindByCleanTitle(string cleanTitle)
{
return Query.SingleOrDefault(c => c.CleanTitle == cleanTitle);
}
}
}