mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-10-02 16:52:04 +02:00
Fixed: Use Length/Count property instead of Enumerable.Count method
This commit is contained in:
@@ -237,7 +237,7 @@ namespace NzbDrone.Core.Configuration
|
||||
|
||||
var valueHolder = parentContainer.Descendants(key).ToList();
|
||||
|
||||
if (valueHolder.Count() == 1)
|
||||
if (valueHolder.Count == 1)
|
||||
{
|
||||
return valueHolder.First().Value.Trim();
|
||||
}
|
||||
|
@@ -16,7 +16,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd.JsonConverters
|
||||
{
|
||||
var split = reader.Value.ToString().Split(':').Select(int.Parse).ToArray();
|
||||
|
||||
switch (split.Count())
|
||||
switch (split.Length)
|
||||
{
|
||||
case 4:
|
||||
return new TimeSpan((split[0] * 24) + split[1], split[2], split[3]);
|
||||
|
@@ -107,9 +107,9 @@ namespace NzbDrone.Core.Download.Pending
|
||||
_logger.Debug("The release {0} is already pending with reason {1}, not adding again", decision.RemoteMovie, reason);
|
||||
}
|
||||
|
||||
if (matchingReports.Count() > 1)
|
||||
if (matchingReports.Count > 1)
|
||||
{
|
||||
_logger.Debug("The release {0} had {1} duplicate pending, removing duplicates.", decision.RemoteMovie, matchingReports.Count() - 1);
|
||||
_logger.Debug("The release {0} had {1} duplicate pending, removing duplicates.", decision.RemoteMovie, matchingReports.Count - 1);
|
||||
|
||||
foreach (var duplicate in matchingReports.Skip(1))
|
||||
{
|
||||
|
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml;
|
||||
@@ -168,7 +168,7 @@ namespace NzbDrone.Core.Indexers.TorrentRss
|
||||
releases = ParseResponse(parser, response);
|
||||
ValidateReleases(releases, indexerSettings);
|
||||
|
||||
if (releases.Count(r => r.Size >= ValidSizeThreshold) > releases.Count() / 2)
|
||||
if (releases.Count(r => r.Size >= ValidSizeThreshold) > releases.Length / 2)
|
||||
{
|
||||
if (releases.Any(r => r.Size < ValidSizeThreshold))
|
||||
{
|
||||
|
@@ -106,7 +106,7 @@ namespace NzbDrone.Core.Jobs
|
||||
|
||||
var currentTasks = _scheduledTaskRepository.All().ToList();
|
||||
|
||||
_logger.Trace("Initializing jobs. Available: {0} Existing: {1}", defaultTasks.Count(), currentTasks.Count());
|
||||
_logger.Trace("Initializing jobs. Available: {0} Existing: {1}", defaultTasks.Length, currentTasks.Count);
|
||||
|
||||
foreach (var job in currentTasks)
|
||||
{
|
||||
|
@@ -1,4 +1,4 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace NzbDrone.Core.Languages
|
||||
@@ -22,27 +22,27 @@ namespace NzbDrone.Core.Languages
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (x.Count() > 1 && y.Count() > 1 && x.Count() > y.Count())
|
||||
if (x.Count > 1 && y.Count > 1 && x.Count > y.Count)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (x.Count() > 1 && y.Count() > 1 && x.Count() < y.Count())
|
||||
if (x.Count > 1 && y.Count > 1 && x.Count < y.Count)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (x.Count() > 1 && y.Count() == 1)
|
||||
if (x.Count > 1 && y.Count == 1)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (x.Count() == 1 && y.Count() > 1)
|
||||
if (x.Count == 1 && y.Count > 1)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (x.Count() == 1 && y.Count() == 1)
|
||||
if (x.Count == 1 && y.Count == 1)
|
||||
{
|
||||
return x.First().Name.CompareTo(y.First().Name);
|
||||
}
|
||||
|
@@ -492,7 +492,7 @@ namespace NzbDrone.Core.MediaFiles.MediaInfo
|
||||
{
|
||||
var channelSplit = channel.Split(new string[] { "." }, StringSplitOptions.None);
|
||||
|
||||
if (channelSplit.Count() == 3)
|
||||
if (channelSplit.Length == 3)
|
||||
{
|
||||
positions += decimal.Parse(string.Format("{0}.{1}", channelSplit[1], channelSplit[2]), CultureInfo.InvariantCulture);
|
||||
}
|
||||
|
@@ -61,7 +61,7 @@ namespace NzbDrone.Core.MediaFiles.MovieImport
|
||||
{
|
||||
var newFiles = filterExistingFiles ? _mediaFileService.FilterExistingFiles(videoFiles.ToList(), movie) : videoFiles.ToList();
|
||||
|
||||
_logger.Debug("Analyzing {0}/{1} files.", newFiles.Count, videoFiles.Count());
|
||||
_logger.Debug("Analyzing {0}/{1} files.", newFiles.Count, videoFiles.Count);
|
||||
|
||||
ParsedMovieInfo downloadClientItemInfo = null;
|
||||
|
||||
|
Reference in New Issue
Block a user