Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/Sonarr/commit/1603b06431918c70bfc194e73b1a7bb0a8745fa0?style=split&whitespace=ignore-change
You should set ROOT_URL correctly, otherwise the web may not work correctly.
2 changed files with
35 additions and
6 deletions
@ -365,5 +365,33 @@ namespace NzbDrone.Core.Test.TvTests
_insertedEpisodes . Should ( ) . OnlyContain ( e = > e . AirDateUtc . Value . ToString ( "s" ) = = episodes . First ( ) . AirDateUtc . Value . ToString ( "s" ) ) ;
_insertedEpisodes . Should ( ) . OnlyContain ( e = > e . AirDateUtc . Value . ToString ( "s" ) = = episodes . First ( ) . AirDateUtc . Value . ToString ( "s" ) ) ;
}
}
[Test]
public void should_prefer_regular_season_when_absolute_numbers_conflict ( )
{
var episodes = Builder < Episode > . CreateListOfSize ( 2 )
. Build ( )
. ToList ( ) ;
episodes [ 0 ] . AbsoluteEpisodeNumber = episodes [ 1 ] . AbsoluteEpisodeNumber ;
episodes [ 0 ] . SeasonNumber = 0 ;
episodes [ 0 ] . EpisodeNumber . Should ( ) . NotBe ( episodes [ 1 ] . EpisodeNumber ) ;
var existingEpisode = new Episode
{
SeasonNumber = episodes [ 0 ] . SeasonNumber ,
EpisodeNumber = episodes [ 0 ] . EpisodeNumber ,
AbsoluteEpisodeNumber = episodes [ 1 ] . AbsoluteEpisodeNumber
} ;
Mocker . GetMock < IEpisodeService > ( ) . Setup ( c = > c . GetEpisodeBySeries ( It . IsAny < int > ( ) ) )
. Returns ( new List < Episode > { existingEpisode } ) ;
Subject . RefreshEpisodeInfo ( GetAnimeSeries ( ) , episodes ) ;
_updatedEpisodes . First ( ) . SeasonNumber . Should ( ) . Be ( episodes [ 1 ] . SeasonNumber ) ;
_updatedEpisodes . First ( ) . EpisodeNumber . Should ( ) . Be ( episodes [ 1 ] . EpisodeNumber ) ;
_updatedEpisodes . First ( ) . AbsoluteEpisodeNumber . Should ( ) . Be ( episodes [ 1 ] . AbsoluteEpisodeNumber ) ;
}
}
}
}
}
@ -41,7 +41,7 @@ namespace NzbDrone.Core.Tv
if ( series . SeriesType = = SeriesTypes . Anime )
if ( series . SeriesType = = SeriesTypes . Anime )
{
{
dupeFreeRemoteEpisodes = MapAbsoluteEpisodeNumbers ( series, dupeFreeRemoteEpisodes) ;
dupeFreeRemoteEpisodes = MapAbsoluteEpisodeNumbers ( dupeFreeRemoteEpisodes) ;
}
}
foreach ( var episode in OrderEpisodes ( series , dupeFreeRemoteEpisodes ) )
foreach ( var episode in OrderEpisodes ( series , dupeFreeRemoteEpisodes ) )
@ -154,12 +154,13 @@ namespace NzbDrone.Core.Tv
}
}
}
}
private List < Episode > MapAbsoluteEpisodeNumbers ( Series series , List< Episode > trakt Episodes)
private List < Episode > MapAbsoluteEpisodeNumbers ( List< Episode > remote Episodes)
{
{
//Return all episodes with no abs number, but distinct for those with abs number
//Return all episodes with no abs number, but distinct for those with abs number
return traktEpisodes . Where ( e = > e . AbsoluteEpisodeNumber . HasValue )
return remoteEpisodes . Where ( e = > e . AbsoluteEpisodeNumber . HasValue )
. OrderByDescending ( e = > e . SeasonNumber )
. DistinctBy ( e = > e . AbsoluteEpisodeNumber . Value )
. DistinctBy ( e = > e . AbsoluteEpisodeNumber . Value )
. Concat ( trakt Episodes. Where ( e = > ! e . AbsoluteEpisodeNumber . HasValue ) )
. Concat ( remote Episodes. Where ( e = > ! e . AbsoluteEpisodeNumber . HasValue ) )
. ToList ( ) ;
. ToList ( ) ;
}
}