Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/Lidarr/commit/4b53cc7e5296ab49ea12a098193ba8401d61dd89?style=unified&whitespace=show-all
You should set ROOT_URL correctly, otherwise the web may not work correctly.
2 changed files with
37 additions and
2 deletions
@ -9,6 +9,7 @@ using NzbDrone.Core.Download;
using NzbDrone.Core.History ;
using NzbDrone.Core.Messaging.Events ;
using NzbDrone.Core.Test.Framework ;
using NzbDrone.Test.Common ;
namespace NzbDrone.Core.Test.Download
{
@ -379,6 +380,30 @@ namespace NzbDrone.Core.Test.Download
Subject . Execute ( new CheckForFinishedDownloadCommand ( ) ) ;
VerifyNoFailedDownloads ( ) ;
ExceptionVerification . IgnoreWarns ( ) ;
}
[Test]
public void should_manual_mark_all_episodes_of_release_as_failed ( )
{
var historyFailed = Builder < History . History > . CreateListOfSize ( 2 )
. All ( )
. With ( v = > v . EventType = = HistoryEventType . Grabbed )
. Do ( v = > v . Data . Add ( "downloadClient" , "SabnzbdClient" ) )
. Do ( v = > v . Data . Add ( "downloadClientId" , "test" ) )
. Build ( )
. ToList ( ) ;
GivenGrabbedHistory ( historyFailed ) ;
Mocker . GetMock < IHistoryService > ( )
. Setup ( s = > s . Get ( It . IsAny < Int32 > ( ) ) )
. Returns < Int32 > ( i = > historyFailed . FirstOrDefault ( v = > v . Id = = i ) ) ;
Subject . MarkAsFailed ( 1 ) ;
VerifyFailedDownloads ( 2 ) ;
}
}
}
@ -35,14 +35,24 @@ namespace NzbDrone.Core.Download
_logger = logger ;
}
public void MarkAsFailed ( TrackedDownload trackedDownload , History . History grabbedH istory)
public void MarkAsFailed ( TrackedDownload trackedDownload , History . History h istory)
{
if ( trackedDownload ! = null & & trackedDownload . State = = TrackedDownloadState . Downloading )
{
trackedDownload . State = TrackedDownloadState . DownloadFailed ;
}
PublishDownloadFailedEvent ( new List < History . History > { grabbedHistory } , "Manually marked as failed" ) ;
var downloadClientId = history . Data . GetValueOrDefault ( DownloadTrackingService . DOWNLOAD_CLIENT_ID ) ;
if ( downloadClientId . IsNullOrWhiteSpace ( ) )
{
PublishDownloadFailedEvent ( new List < History . History > { history } , "Manually marked as failed" ) ;
}
else
{
var grabbedHistory = GetHistoryItems ( _historyService . Grabbed ( ) , downloadClientId ) ;
PublishDownloadFailedEvent ( grabbedHistory , "Manually marked as failed" ) ;
}
}
public void CheckForFailedItem ( IDownloadClient downloadClient , TrackedDownload trackedDownload , List < History . History > grabbedHistory , List < History . History > failedHistory )