mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-22 22:14:44 -04:00
updated seriesrepo to use the new syntax.
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using NzbDrone.Core.Datastore;
|
||||
using ServiceStack.OrmLite;
|
||||
|
||||
namespace NzbDrone.Core.Tv
|
||||
{
|
||||
@@ -24,27 +22,27 @@ namespace NzbDrone.Core.Tv
|
||||
|
||||
public bool SeriesPathExists(string path)
|
||||
{
|
||||
return Database.Exists<Series>("WHERE Path = {0}", path);
|
||||
return Any(c => c.Path == path);
|
||||
}
|
||||
|
||||
public List<Series> Search(string title)
|
||||
{
|
||||
return Database.Select<Series>(s => s.Title.Contains(title));
|
||||
return Where(s => s.Title.Contains(title));
|
||||
}
|
||||
|
||||
public Series GetByTitle(string cleanTitle)
|
||||
{
|
||||
return Database.Select<Series>(s => s.CleanTitle.Equals(cleanTitle)).SingleOrDefault();
|
||||
return SingleOrDefault(s => s.CleanTitle.Equals(cleanTitle));
|
||||
}
|
||||
|
||||
public Series FindByTvdbId(int tvdbId)
|
||||
{
|
||||
return Database.Select<Series>(s => s.TvDbId.Equals(tvdbId)).SingleOrDefault();
|
||||
return SingleOrDefault(s => s.TvDbId.Equals(tvdbId));
|
||||
}
|
||||
|
||||
public void SetSeriesType(int seriesId, SeriesTypes seriesType)
|
||||
{
|
||||
Database.UpdateOnly(new Series { SeriesType = seriesType }, s => s.SeriesType, s => s.Id == seriesId);
|
||||
UpdateFields(new Series { Id = seriesId, SeriesType = seriesType }, s => s.SeriesType);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user