Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/Lidarr/commit/081c5fc33269666dfb1033f3510a1fb8eaf93137?style=split&whitespace=ignore-eol
You should set ROOT_URL correctly, otherwise the web may not work correctly.
3 changed files with
35 additions and
1 deletions
@ -10,6 +10,28 @@ namespace NzbDrone.Core.Test.Datastore.Migration
[TestFixture]
[TestFixture]
public class fix_extra_file_extensionsFixture : MigrationTest < fix_extra_file_extension >
public class fix_extra_file_extensionsFixture : MigrationTest < fix_extra_file_extension >
{
{
[Test]
public void should_extra_files_that_do_not_have_an_extension ( )
{
var db = WithMigrationTestDb ( c = >
{
c . Insert . IntoTable ( "ExtraFiles" ) . Row ( new
{
SeriesId = 1 ,
SeasonNumber = 1 ,
EpisodeFileId = 1 ,
RelativePath = "Series.Title.S01E01" ,
Added = "2016-05-30 20:23:02.3725923" ,
LastUpdated = "2016-05-30 20:23:02.3725923" ,
Extension = ""
} ) ;
} ) ;
var items = db . Query ( "Select * from ExtraFiles" ) ;
items . Should ( ) . BeEmpty ( ) ;
}
[Test]
[Test]
public void should_fix_double_extension ( )
public void should_fix_double_extension ( )
{
{
@ -10,6 +10,10 @@ namespace NzbDrone.Core.Datastore.Migration
{
{
protected override void MainDbUpgrade ( )
protected override void MainDbUpgrade ( )
{
{
// Delete extraneous files without extensions that Sonarr found previously,
// these will be blocked from importing as well.
Execute . Sql ( "DELETE FROM ExtraFiles WHERE TRIM(Extension) = ''" ) ;
Execute . WithConnection ( FixExtraFileExtension ) ;
Execute . WithConnection ( FixExtraFileExtension ) ;
}
}
@ -36,6 +36,14 @@ namespace NzbDrone.Core.Extras.Others
foreach ( var possibleExtraFile in filterResult . FilesOnDisk )
foreach ( var possibleExtraFile in filterResult . FilesOnDisk )
{
{
var extension = Path . GetExtension ( possibleExtraFile ) ;
if ( extension . IsNullOrWhiteSpace ( ) )
{
_logger . Debug ( "No extension for file: {0}" , possibleExtraFile ) ;
continue ;
}
var localEpisode = _parsingService . GetLocalEpisode ( possibleExtraFile , series ) ;
var localEpisode = _parsingService . GetLocalEpisode ( possibleExtraFile , series ) ;
if ( localEpisode = = null )
if ( localEpisode = = null )
@ -62,7 +70,7 @@ namespace NzbDrone.Core.Extras.Others
SeasonNumber = localEpisode . SeasonNumber ,
SeasonNumber = localEpisode . SeasonNumber ,
EpisodeFileId = localEpisode . Episodes . First ( ) . EpisodeFileId ,
EpisodeFileId = localEpisode . Episodes . First ( ) . EpisodeFileId ,
RelativePath = series . Path . GetRelativePath ( possibleExtraFile ) ,
RelativePath = series . Path . GetRelativePath ( possibleExtraFile ) ,
Extension = Path. G etE xtension( possibleExtraFile )
Extension = extension
} ;
} ;
extraFiles . Add ( extraFile ) ;
extraFiles . Add ( extraFile ) ;