Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/Readarr/commit/19fc3bad6c5ef0c0915a63cac0869bb77568ee44
You should set ROOT_URL correctly, otherwise the web may not work correctly.
2 changed files with
40 additions and
5 deletions
@ -2,6 +2,7 @@
using FizzWare.NBuilder ;
using FluentAssertions ;
using Marr.Data ;
using Moq ;
using NUnit.Framework ;
using NzbDrone.Core.MediaFiles ;
using NzbDrone.Core.MediaFiles.EpisodeImport.Specifications ;
@ -109,5 +110,28 @@ namespace NzbDrone.Core.Test.MediaFileTests.EpisodeImportTests
Subject . IsSatisfiedBy ( _localEpisode ) . Should ( ) . BeTrue ( ) ;
}
[Test]
[Explicit]
public void should_return_false_if_exact_path_exists_in_db ( )
{
Mocker . GetMock < IMediaFileService > ( )
. Setup ( s = > s . Exists ( It . IsAny < string > ( ) ) )
. Returns ( true ) ;
_localEpisode . Episodes = Builder < Episode > . CreateListOfSize ( 1 )
. All ( )
. With ( e = > e . EpisodeFileId = 1 )
. With ( e = > e . EpisodeFile = new LazyLoaded < EpisodeFile > (
new EpisodeFile
{
Path = @"C:\Test\30 Rock\Season 01\30.rock.s01e01.pilot.avi" ,
Size = 100
} ) )
. Build ( )
. ToList ( ) ;
Subject . IsSatisfiedBy ( _localEpisode ) . Should ( ) . BeFalse ( ) ;
}
}
}
@ -7,10 +7,12 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications
{
public class NotExistingFileSpecification : IImportDecisionEngineSpecification
{
private readonly IMediaFileService _mediaFileService ;
private readonly Logger _logger ;
public NotExistingFileSpecification ( Logger logger )
public NotExistingFileSpecification ( IMediaFileService mediaFileService , Logger logger )
{
_mediaFileService = mediaFileService ;
_logger = logger ;
}
@ -18,16 +20,25 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport.Specifications
public bool IsSatisfiedBy ( LocalEpisode localEpisode )
{
var episodeFiles = localEpisode . Episodes . Where ( e = > e . EpisodeFileId > 0 ) . Select ( e = > e . EpisodeFile . Value ) ;
// if (_mediaFileService.Exists(localEpisode.Path))
// {
// _logger.Trace("File is a match for an existing episode file: {0}", localEpisode.Path);
// return false;
// }
foreach ( var episodeFile in episodeFiles )
var existingFiles = localEpisode . Episodes . Where ( e = > e . EpisodeFileId > 0 ) . Select ( e = > e . EpisodeFile . Value ) ;
foreach ( var existingFile in existingFiles )
{
if ( Path . GetFileName ( episodeFile . Path ) = = Path . GetFileName ( localEpisode . Path ) & &
e pisode File. Size = = localEpisode . Size )
if ( Path . GetFileName ( e xisting File. Path ) = = Path . GetFileName ( localEpisode . Path ) & &
e xisting File. Size = = localEpisode . Size )
{
_logger . Trace ( "File is a match for an existing episode file: {0}" , localEpisode . Path ) ;
return false ;
}
_logger . Trace ( "Existing filename: {0} size: {1}" , Path . GetFileName ( existingFile . Path ) , existingFile . Size ) ;
_logger . Trace ( "New filename: {0} size: {1}" , Path . GetFileName ( localEpisode . Path ) , localEpisode . Size ) ;
}
return true ;