Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/Readarr/commit/855a8dbf85e9c3106ab1ecd43e93b42cfc4752d5
You should set ROOT_URL correctly, otherwise the web may not work correctly.
4 changed files with
36 additions and
0 deletions
@ -224,5 +224,18 @@ namespace NzbDrone.Core.Test.MediaFiles.TrackImport.Specifications
Subject . IsSatisfiedBy ( _localTrack ) . Accepted . Should ( ) . BeTrue ( ) ;
}
[Test]
public void should_return_true_if_track_file_is_null ( )
{
_localTrack . Tracks = Builder < Track > . CreateListOfSize ( 2 )
. All ( )
. With ( e = > e . TrackFileId = 1 )
. With ( e = > e . TrackFile = new LazyLoaded < TrackFile > ( null ) )
. Build ( )
. ToList ( ) ;
Subject . IsSatisfiedBy ( _localTrack ) . Accepted . Should ( ) . BeTrue ( ) ;
}
}
}
@ -181,5 +181,20 @@ namespace NzbDrone.Core.Test.MediaFiles
Subject . UpgradeTrackFile ( _trackFile , _localTrack ) . OldFiles . Count . Should ( ) . Be ( 2 ) ;
}
[Test]
public void should_import_if_existing_file_doesnt_exist_in_db ( )
{
_localTrack . Tracks = Builder < Track > . CreateListOfSize ( 1 )
. All ( )
. With ( e = > e . TrackFileId = 1 )
. With ( e = > e . TrackFile = new LazyLoaded < TrackFile > ( null ) )
. Build ( )
. ToList ( ) ;
Subject . UpgradeTrackFile ( _trackFile , _localTrack ) ;
Mocker . GetMock < IMediaFileService > ( ) . Verify ( v = > v . Delete ( _localTrack . Tracks . Single ( ) . TrackFile . Value , It . IsAny < DeleteMediaFileReason > ( ) ) , Times . Never ( ) ) ;
}
}
}
@ -27,6 +27,13 @@ namespace NzbDrone.Core.MediaFiles.TrackImport.Specifications
foreach ( var track in localTrack . Tracks . Where ( e = > e . TrackFileId > 0 ) )
{
var trackFile = track . TrackFile . Value ;
if ( trackFile = = null )
{
_logger . Trace ( "Unable to get track file details from the DB. TrackId: {0} TrackFileId: {1}" , track . Id , track . TrackFileId ) ;
continue ;
}
var qualityCompare = qualityComparer . Compare ( localTrack . Quality . Quality , trackFile . Quality . Quality ) ;
if ( qualityCompare < 0 )
@ -43,6 +43,7 @@ namespace NzbDrone.Core.MediaFiles
var existingFiles = localTrack . Tracks
. Where ( e = > e . TrackFileId > 0 )
. Select ( e = > e . TrackFile . Value )
. Where ( e = > e ! = null )
. GroupBy ( e = > e . Id )
. ToList ( ) ;