1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-18 23:48:35 +02:00
Sonarr/NzbDrone.Core/DataAugmentation/Scene/SceneMappingRepository.cs

31 lines
905 B
C#
Raw Normal View History

2013-03-02 21:25:39 +03:00
using System.Linq;
2013-05-06 00:24:33 +03:00
using NzbDrone.Common.Messaging;
2013-03-02 21:25:39 +03:00
using NzbDrone.Core.Datastore;
2013-04-01 05:43:58 +03:00
namespace NzbDrone.Core.DataAugmentation.Scene
2013-03-02 21:25:39 +03:00
{
public interface ISceneMappingRepository : IBasicRepository<SceneMapping>
{
SceneMapping FindByTvdbId(int tvdbId);
SceneMapping FindByCleanTitle(string cleanTitle);
}
public class SceneMappingRepository : BasicRepository<SceneMapping>, ISceneMappingRepository
{
2013-05-06 00:24:33 +03:00
public SceneMappingRepository(IDatabase database, IMessageAggregator messageAggregator)
: base(database, messageAggregator)
2013-03-02 21:25:39 +03:00
{
}
public SceneMapping FindByTvdbId(int tvdbId)
{
2013-03-27 06:44:52 +03:00
return Query.SingleOrDefault(c => c.TvdbId == tvdbId);
2013-03-02 21:25:39 +03:00
}
public SceneMapping FindByCleanTitle(string cleanTitle)
{
2013-03-27 06:44:52 +03:00
return Query.SingleOrDefault(c => c.CleanTitle == cleanTitle);
2013-03-02 21:25:39 +03:00
}
}
}