Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/Sonarr/commit/587aff602a2a3e2b70709acd98b7f37c5d145fc3
You should set ROOT_URL correctly, otherwise the web may not work correctly.
2 changed files with
39 additions and
1 deletions
@ -327,6 +327,42 @@ namespace NzbDrone.Core.Test.MediaFiles
ExceptionVerification . ExpectedErrors ( 1 ) ;
}
[Test]
public void should_not_delete_if_no_files_were_imported ( )
{
GivenValidSeries ( ) ;
var localEpisode = new LocalEpisode ( ) ;
var imported = new List < ImportDecision > ( ) ;
imported . Add ( new ImportDecision ( localEpisode ) ) ;
Mocker . GetMock < IMakeImportDecision > ( )
. Setup ( s = > s . GetImportDecisions ( It . IsAny < List < String > > ( ) , It . IsAny < Series > ( ) , null , true ) )
. Returns ( imported ) ;
Mocker . GetMock < IImportApprovedEpisodes > ( )
. Setup ( s = > s . Import ( It . IsAny < List < ImportDecision > > ( ) , true , null ) )
. Returns ( new List < ImportResult > ( ) ) ;
Mocker . GetMock < IDetectSample > ( )
. Setup ( s = > s . IsSample ( It . IsAny < Series > ( ) ,
It . IsAny < QualityModel > ( ) ,
It . IsAny < String > ( ) ,
It . IsAny < Int64 > ( ) ,
It . IsAny < Int32 > ( ) ) )
. Returns ( true ) ;
Mocker . GetMock < IDiskProvider > ( )
. Setup ( s = > s . GetFileSize ( It . IsAny < string > ( ) ) )
. Returns ( 15. Megabytes ( ) ) ;
Subject . ProcessRootFolder ( new DirectoryInfo ( _droneFactory ) ) ;
Mocker . GetMock < IDiskProvider > ( )
. Verify ( v = > v . DeleteFolder ( It . IsAny < String > ( ) , true ) , Times . Never ( ) ) ;
}
private void VerifyNoImport ( )
{
Mocker . GetMock < IImportApprovedEpisodes > ( ) . Verify ( c = > c . Import ( It . IsAny < List < ImportDecision > > ( ) , true , null ) ,
@ -152,7 +152,9 @@ namespace NzbDrone.Core.MediaFiles
var decisions = _importDecisionMaker . GetImportDecisions ( videoFiles . ToList ( ) , series , folderInfo , true ) ;
var importResults = _importApprovedEpisodes . Import ( decisions , true , downloadClientItem ) ;
if ( ( downloadClientItem = = null | | ! downloadClientItem . IsReadOnly ) & & importResults . Any ( ) & & ShouldDeleteFolder ( directoryInfo , series ) )
if ( ( downloadClientItem = = null | | ! downloadClientItem . IsReadOnly ) & &
importResults . Any ( i = > i . Result = = ImportResultType . Imported ) & &
ShouldDeleteFolder ( directoryInfo , series ) )
{
_logger . Debug ( "Deleting folder after importing valid files" ) ;
_diskProvider . DeleteFolder ( directoryInfo . FullName , true ) ;