1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-22 22:16:13 -04:00

Dapper and STJson

Co-Authored-By: ta264 <ta264@users.noreply.github.com>
This commit is contained in:
Qstick
2021-08-04 00:00:28 -04:00
committed by Mark McDowall
parent 1c22a1ec0d
commit 2e953a0eb1
259 changed files with 3719 additions and 10852 deletions
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System.Linq;
using NzbDrone.Core.Datastore;
using NzbDrone.Core.Messaging.Events;
@@ -21,25 +22,22 @@ namespace NzbDrone.Core.MediaFiles
public List<EpisodeFile> GetFilesBySeries(int seriesId)
{
return Query.Where(c => c.SeriesId == seriesId).ToList();
return Query(c => c.SeriesId == seriesId).ToList();
}
public List<EpisodeFile> GetFilesBySeason(int seriesId, int seasonNumber)
{
return Query.Where(c => c.SeriesId == seriesId)
.AndWhere(c => c.SeasonNumber == seasonNumber)
.ToList();
return Query(c => c.SeriesId == seriesId && c.SeasonNumber == seasonNumber).ToList();
}
public List<EpisodeFile> GetFilesWithoutMediaInfo()
{
return Query.Where(c => c.MediaInfo == null).ToList();
return Query(c => c.MediaInfo == null).ToList();
}
public List<EpisodeFile> GetFilesWithRelativePath(int seriesId, string relativePath)
{
return Query.Where(c => c.SeriesId == seriesId)
.AndWhere(c => c.RelativePath == relativePath)
return Query(c => c.SeriesId == seriesId && c.RelativePath == relativePath)
.ToList();
}
}