mirror of
https://github.com/Sonarr/Sonarr
synced 2025-03-03 18:26:42 +00:00
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.
This commit is contained in:
parent
207ea607a7
commit
2bf97fd76f
3 changed files with 5 additions and 4 deletions
|
@ -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…
Reference in a new issue