Fix: Size will be displayed in best format when rejected (instead of bytes). It will also be displayed as info so it shows in the normal log.

pull/10/head
Mark McDowall 13 years ago
parent 207ea607a7
commit 2bf97fd76f

@ -2,13 +2,13 @@
namespace NzbDrone.Core.Helpers
{
public class FileSizeFormatHelper
public static class FileSizeFormatHelper
{
private const Decimal OneKiloByte = 1024M;
private const Decimal OneMegaByte = OneKiloByte * 1024M;
private const Decimal OneGigaByte = OneMegaByte * 1024M;
public static string Format(long bytes, int precision)
public static string Format(long bytes, int precision = 0)
{
if (bytes == 0)
return "0B";

@ -224,7 +224,7 @@
<Compile Include="Datastore\Migrations\NzbDroneMigration.cs" />
<Compile Include="Fluent.cs" />
<Compile Include="Helpers\EpisodeSortingHelper.cs" />
<Compile Include="Helpers\FileSizeFormatHelpercs.cs" />
<Compile Include="Helpers\FileSizeFormatHelper.cs" />
<Compile Include="Helpers\SortHelper.cs" />
<Compile Include="Jobs\CheckpointJob.cs" />
<Compile Include="Providers\AnalyticsProvider.cs" />

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using Ninject;
using NLog;
using NzbDrone.Core.Helpers;
using NzbDrone.Core.Model;
using NzbDrone.Core.Repository;
using NzbDrone.Core.Repository.Quality;
@ -88,7 +89,7 @@ namespace NzbDrone.Core.Providers
if (!IsAcceptableSize(parsedReport))
{
Logger.Trace("Size: {0} is not acceptable for Quality: {1}", parsedReport.Size, parsedReport.Quality);
Logger.Info("Size: {0} is not acceptable for Quality: {1}", FileSizeFormatHelper.Format(parsedReport.Size, 2), parsedReport.Quality);
return false;
}

Loading…
Cancel
Save