Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/Radarr/commit/9ef031bd9e08bd4aec281522198c9e153bd5a77f?style=unified&whitespace=ignore-eol
You should set ROOT_URL correctly, otherwise the web may not work correctly.
2 changed files with
24 additions and
2 deletions
@ -1,4 +1,6 @@
using System.Collections.Generic ;
using System.Linq ;
using Dapper ;
using NzbDrone.Core.Datastore ;
using NzbDrone.Core.Messaging.Events ;
@ -8,6 +10,7 @@ namespace NzbDrone.Core.ImportLists.ImportExclusions
{
bool IsMovieExcluded ( int tmdbid ) ;
ImportExclusion GetByTmdbid ( int tmdbid ) ;
List < int > AllExcludedTmdbIds ( ) ;
}
public class ImportExclusionsRepository : BasicRepository < ImportExclusion > , IImportExclusionsRepository
@ -26,5 +29,12 @@ namespace NzbDrone.Core.ImportLists.ImportExclusions
{
return Query ( x = > x . TmdbId = = tmdbid ) . First ( ) ;
}
public List < int > AllExcludedTmdbIds ( )
{
using var conn = _database . OpenConnection ( ) ;
return conn . Query < int > ( "SELECT \"TmdbId\" FROM \"ImportExclusions\"" ) . ToList ( ) ;
}
}
}
@ -41,7 +41,7 @@ namespace NzbDrone.Core.ImportLists.ImportExclusions
public List < ImportExclusion > AddExclusions ( List < ImportExclusion > exclusions )
{
_exclusionRepository . InsertMany ( exclusions) ;
_exclusionRepository . InsertMany ( DeDupeExclusions( exclusions) ) ;
return exclusions ;
}
@ -76,8 +76,20 @@ namespace NzbDrone.Core.ImportLists.ImportExclusions
if ( message . AddExclusion )
{
_logger . Debug ( "Adding {0} Deleted Movies to Import Exclusions" , message . Movies . Count ) ;
_exclusionRepository . InsertMany ( message . Movies . Select ( m = > new ImportExclusion { TmdbId = m . TmdbId , MovieTitle = m . Title , MovieYear = m . Year } ) . ToList ( ) ) ;
var exclusions = message . Movies . Select ( m = > new ImportExclusion { TmdbId = m . TmdbId , MovieTitle = m . Title , MovieYear = m . Year } ) . ToList ( ) ;
_exclusionRepository . InsertMany ( DeDupeExclusions ( exclusions ) ) ;
}
}
private List < ImportExclusion > DeDupeExclusions ( List < ImportExclusion > exclusions )
{
var existingExclusions = _exclusionRepository . AllExcludedTmdbIds ( ) ;
return exclusions
. DistinctBy ( x = > x . TmdbId )
. Where ( x = > ! existingExclusions . Contains ( x . TmdbId ) )
. ToList ( ) ;
}
}
}