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.
30 lines
815 B
30 lines
815 B
12 years ago
|
using System.Linq;
|
||
|
using NzbDrone.Core.Datastore;
|
||
|
|
||
12 years ago
|
namespace NzbDrone.Core.DataAugmentation.Scene
|
||
12 years ago
|
{
|
||
|
public interface ISceneMappingRepository : IBasicRepository<SceneMapping>
|
||
|
{
|
||
|
SceneMapping FindByTvdbId(int tvdbId);
|
||
|
SceneMapping FindByCleanTitle(string cleanTitle);
|
||
|
|
||
|
}
|
||
|
|
||
|
public class SceneMappingRepository : BasicRepository<SceneMapping>, ISceneMappingRepository
|
||
|
{
|
||
12 years ago
|
public SceneMappingRepository(IDatabase database)
|
||
12 years ago
|
: base(database)
|
||
12 years ago
|
{
|
||
|
}
|
||
|
|
||
|
public SceneMapping FindByTvdbId(int tvdbId)
|
||
|
{
|
||
12 years ago
|
return Query.SingleOrDefault(c => c.TvdbId == tvdbId);
|
||
12 years ago
|
}
|
||
|
|
||
|
public SceneMapping FindByCleanTitle(string cleanTitle)
|
||
|
{
|
||
12 years ago
|
return Query.SingleOrDefault(c => c.CleanTitle == cleanTitle);
|
||
12 years ago
|
}
|
||
|
}
|
||
|
}
|