mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
still very broken
This commit is contained in:
parent
2d4998d52d
commit
4504232956
43 changed files with 264 additions and 339 deletions
37
NzbDrone.Core/Tv/SeriesRepository.cs
Normal file
37
NzbDrone.Core/Tv/SeriesRepository.cs
Normal file
|
@ -0,0 +1,37 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NzbDrone.Common;
|
||||
using NzbDrone.Core.Datastore;
|
||||
|
||||
namespace NzbDrone.Core.Tv
|
||||
{
|
||||
public interface ISeriesRepository : IBasicRepository<Series>
|
||||
{
|
||||
bool SeriesPathExists(string path);
|
||||
List<Series> Search(string title);
|
||||
Series Get(string cleanTitle);
|
||||
}
|
||||
|
||||
public class SeriesRepository : BasicRepository<Series>, ISeriesRepository
|
||||
{
|
||||
public SeriesRepository(IObjectDatabase objectDatabase)
|
||||
: base(objectDatabase)
|
||||
{
|
||||
}
|
||||
|
||||
public bool SeriesPathExists(string path)
|
||||
{
|
||||
return Queryable.Any(s => DiskProvider.PathEquals(s.Path, path));
|
||||
}
|
||||
|
||||
public List<Series> Search(string title)
|
||||
{
|
||||
return Queryable.Where(s => s.Title.Contains(title)).ToList();
|
||||
}
|
||||
|
||||
public Series Get(string cleanTitle)
|
||||
{
|
||||
return Queryable.SingleOrDefault(s => s.CleanTitle.Equals(cleanTitle));
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue