Compare commits

...

4 Commits

Author SHA1 Message Date
Qstick
edc522e412 Remove Non-Failing Rules
(cherry picked from commit e8b862a38059da4fcb5ab1ab51cf838fe5424f47)
2023-03-16 00:33:19 +00:00
santschi
d77aa82961 Fix: Stop ImageUrl from being overwritten 2023-03-12 16:45:44 -05:00
cicomalieran
c7a4060c4c Fixed: Processing very long ETA from Transmission
(cherry picked from commit 9800bd6b439257e73e3545e125cd03900a3036bb)
2023-03-12 16:13:18 -05:00
Qstick
64e6f98683 Bump version to 0.1.5 2023-02-25 20:58:09 -06:00
7 changed files with 34 additions and 9 deletions

View File

@@ -204,9 +204,6 @@ dotnet_diagnostic.CA2000.severity = suggestion
dotnet_diagnostic.CA2002.severity = suggestion
dotnet_diagnostic.CA2007.severity = suggestion
dotnet_diagnostic.CA2008.severity = suggestion
dotnet_diagnostic.CA2009.severity = suggestion
dotnet_diagnostic.CA2010.severity = suggestion
dotnet_diagnostic.CA2011.severity = suggestion
dotnet_diagnostic.CA2012.severity = suggestion
dotnet_diagnostic.CA2013.severity = suggestion
dotnet_diagnostic.CA2100.severity = suggestion

View File

@@ -9,7 +9,7 @@ variables:
testsFolder: './_tests'
yarnCacheFolder: $(Pipeline.Workspace)/.yarn
nugetCacheFolder: $(Pipeline.Workspace)/.nuget/packages
majorVersion: '0.1.4'
majorVersion: '0.1.5'
minorVersion: $[counter('minorVersion', 1)]
readarrVersion: '$(majorVersion).$(minorVersion)'
buildName: '$(Build.SourceBranchName).$(readarrVersion)'

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using FluentAssertions;
@@ -275,7 +276,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.TransmissionTests
[TestCase(-1)] // Infinite/Unknown
[TestCase(-2)] // Magnet Downloading
public void should_ignore_negative_eta(int eta)
public void should_ignore_negative_eta(long eta)
{
_completed.Eta = eta;
@@ -284,6 +285,26 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.TransmissionTests
item.RemainingTime.Should().NotHaveValue();
}
[TestCase(2147483648)] // 2038-01-19T03:14:08Z > int.MaxValue as unix timestamp can be either an int or a long
public void should_support_long_values_for_eta_in_seconds(long eta)
{
_downloading.Eta = eta;
PrepareClientToReturnDownloadingItem();
var item = Subject.GetItems().Single();
item.RemainingTime.Should().Be(TimeSpan.FromSeconds(eta));
}
[TestCase(2147483648000)] // works with milliseconds format too
public void should_support_long_values_for_eta_in_milliseconds(long eta)
{
_downloading.Eta = eta;
PrepareClientToReturnDownloadingItem();
var item = Subject.GetItems().Single();
item.RemainingTime.Should().Be(TimeSpan.FromMilliseconds(eta));
}
[Test]
public void should_not_be_removable_and_should_not_allow_move_files_if_max_ratio_reached_and_not_stopped()
{

View File

@@ -271,7 +271,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.VuzeTests
[TestCase(-1)] // Infinite/Unknown
[TestCase(-2)] // Magnet Downloading
public void should_ignore_negative_eta(int eta)
public void should_ignore_negative_eta(long eta)
{
_completed.Eta = eta;

View File

@@ -80,7 +80,14 @@ namespace NzbDrone.Core.Download.Clients.Transmission
if (torrent.Eta >= 0)
{
item.RemainingTime = TimeSpan.FromSeconds(torrent.Eta);
try
{
item.RemainingTime = TimeSpan.FromSeconds(torrent.Eta);
}
catch (OverflowException)
{
item.RemainingTime = TimeSpan.FromMilliseconds(torrent.Eta);
}
}
if (!torrent.ErrorString.IsNullOrWhiteSpace())

View File

@@ -9,7 +9,7 @@ namespace NzbDrone.Core.Download.Clients.Transmission
public long TotalSize { get; set; }
public long LeftUntilDone { get; set; }
public bool IsFinished { get; set; }
public int Eta { get; set; }
public long Eta { get; set; }
public TransmissionTorrentStatus Status { get; set; }
public int SecondsDownloading { get; set; }
public int SecondsSeeding { get; set; }

View File

@@ -51,7 +51,7 @@ namespace NzbDrone.Core.MetadataSource.Goodreads
}
ImageUrl = element.ElementAsString("image_url");
ImageUrl = element.ElementAsString("large_image_url");
LargeImageUrl = element.ElementAsString("large_image_url");
}
}
}