mirror of
https://github.com/Prowlarr/Prowlarr
synced 2026-01-26 09:32:23 +01:00
Fixed: (Core) Use MinBy and MaxBy
This commit is contained in:
parent
e5ccbaaf24
commit
a184bb0784
2 changed files with 3 additions and 8 deletions
|
|
@ -478,8 +478,7 @@ public virtual IMount GetMount(string path)
|
|||
|
||||
return mounts.Where(drive => drive.RootDirectory.PathEquals(path) ||
|
||||
drive.RootDirectory.IsParentPath(path))
|
||||
.OrderByDescending(drive => drive.RootDirectory.Length)
|
||||
.FirstOrDefault();
|
||||
.MaxBy(drive => drive.RootDirectory.Length);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -31,9 +31,7 @@ public HistoryRepository(IMainDatabase database, IEventAggregator eventAggregato
|
|||
|
||||
public History MostRecentForDownloadId(string downloadId)
|
||||
{
|
||||
return FindByDownloadId(downloadId)
|
||||
.OrderByDescending(h => h.Date)
|
||||
.FirstOrDefault();
|
||||
return FindByDownloadId(downloadId).MaxBy(h => h.Date);
|
||||
}
|
||||
|
||||
public List<History> FindByDownloadId(string downloadId)
|
||||
|
|
@ -75,9 +73,7 @@ public void Cleanup(int days)
|
|||
|
||||
public History MostRecentForIndexer(int indexerId)
|
||||
{
|
||||
return Query(x => x.IndexerId == indexerId)
|
||||
.OrderByDescending(h => h.Date)
|
||||
.FirstOrDefault();
|
||||
return Query(x => x.IndexerId == indexerId).MaxBy(h => h.Date);
|
||||
}
|
||||
|
||||
public List<History> Between(DateTime start, DateTime end)
|
||||
|
|
|
|||
Loading…
Reference in a new issue