@ -21,8 +21,7 @@ namespace NzbDrone.Core.Housekeeping.Housekeepers
private void DeleteOrphanedByMovie ( )
{
using ( var mapper = _database . OpenConnection ( ) )
{
using var mapper = _database . OpenConnection ( ) ;
mapper . Execute ( @"DELETE FROM ""MetadataFiles" "
WHERE "" Id "" IN (
SELECT "" MetadataFiles "" . "" Id "" FROM "" MetadataFiles ""
@ -30,12 +29,10 @@ namespace NzbDrone.Core.Housekeeping.Housekeepers
ON "" MetadataFiles "" . "" MovieId "" = "" Movies "" . "" Id ""
WHERE "" Movies "" . "" Id "" IS NULL ) ");
}
}
private void DeleteOrphanedByMovieFile ( )
{
using ( var mapper = _database . OpenConnection ( ) )
{
using var mapper = _database . OpenConnection ( ) ;
mapper . Execute ( @"DELETE FROM ""MetadataFiles" "
WHERE "" Id "" IN (
SELECT "" MetadataFiles "" . "" Id "" FROM "" MetadataFiles ""
@ -44,12 +41,10 @@ namespace NzbDrone.Core.Housekeeping.Housekeepers
WHERE "" MetadataFiles "" . "" MovieFileId "" > 0
AND "" MovieFiles "" . "" Id "" IS NULL ) ");
}
}
private void DeleteWhereMovieFileIsZero ( )
{
using ( var mapper = _database . OpenConnection ( ) )
{
using var mapper = _database . OpenConnection ( ) ;
mapper . Execute ( @"DELETE FROM ""MetadataFiles" "
WHERE "" Id "" IN (
SELECT "" Id "" FROM "" MetadataFiles ""
@ -58,4 +53,3 @@ namespace NzbDrone.Core.Housekeeping.Housekeepers
}
}
}
}