You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
using System.Data;
|
|
|
|
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(IDatabase database)
|
|
|
|
: base(database)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
public SceneMapping FindByTvdbId(int tvdbId)
|
|
|
|
{
|
|
|
|
return Queryable().SingleOrDefault(c => c.TvdbId == tvdbId);
|
|
|
|
}
|
|
|
|
|
|
|
|
public SceneMapping FindByCleanTitle(string cleanTitle)
|
|
|
|
{
|
|
|
|
return Queryable().SingleOrDefault(c => c.CleanTitle == cleanTitle);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|