|
|
|
@ -23,8 +23,7 @@ namespace NzbDrone.Core.Housekeeping.Housekeepers
|
|
|
|
|
|
|
|
|
|
private void DeleteOrphanedByAuthor()
|
|
|
|
|
{
|
|
|
|
|
using (var mapper = _database.OpenConnection())
|
|
|
|
|
{
|
|
|
|
|
using var mapper = _database.OpenConnection();
|
|
|
|
|
mapper.Execute(@"DELETE FROM ""MetadataFiles""
|
|
|
|
|
WHERE ""Id"" IN (
|
|
|
|
|
SELECT ""MetadataFiles"".""Id"" FROM ""MetadataFiles""
|
|
|
|
@ -32,12 +31,10 @@ namespace NzbDrone.Core.Housekeeping.Housekeepers
|
|
|
|
|
ON ""MetadataFiles"".""AuthorId"" = ""Authors"".""Id""
|
|
|
|
|
WHERE ""Authors"".""Id"" IS NULL)");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void DeleteOrphanedByBook()
|
|
|
|
|
{
|
|
|
|
|
using (var mapper = _database.OpenConnection())
|
|
|
|
|
{
|
|
|
|
|
using var mapper = _database.OpenConnection();
|
|
|
|
|
mapper.Execute(@"DELETE FROM ""MetadataFiles""
|
|
|
|
|
WHERE ""Id"" IN (
|
|
|
|
|
SELECT ""MetadataFiles"".""Id"" FROM ""MetadataFiles""
|
|
|
|
@ -46,12 +43,10 @@ namespace NzbDrone.Core.Housekeeping.Housekeepers
|
|
|
|
|
WHERE ""MetadataFiles"".""BookId"" > 0
|
|
|
|
|
AND ""Books"".""Id"" IS NULL)");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void DeleteOrphanedByTrackFile()
|
|
|
|
|
{
|
|
|
|
|
using (var mapper = _database.OpenConnection())
|
|
|
|
|
{
|
|
|
|
|
using var mapper = _database.OpenConnection();
|
|
|
|
|
mapper.Execute(@"DELETE FROM ""MetadataFiles""
|
|
|
|
|
WHERE ""Id"" IN (
|
|
|
|
|
SELECT ""MetadataFiles"".""Id"" FROM ""MetadataFiles""
|
|
|
|
@ -60,24 +55,20 @@ namespace NzbDrone.Core.Housekeeping.Housekeepers
|
|
|
|
|
WHERE ""MetadataFiles"".""BookFileId"" > 0
|
|
|
|
|
AND ""BookFiles"".""Id"" IS NULL)");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void DeleteWhereBookIdIsZero()
|
|
|
|
|
{
|
|
|
|
|
using (var mapper = _database.OpenConnection())
|
|
|
|
|
{
|
|
|
|
|
using var mapper = _database.OpenConnection();
|
|
|
|
|
mapper.Execute(@"DELETE FROM ""MetadataFiles""
|
|
|
|
|
WHERE ""Id"" IN (
|
|
|
|
|
SELECT ""Id"" FROM ""MetadataFiles""
|
|
|
|
|
WHERE ""Type"" IN (2, 4)
|
|
|
|
|
AND ""BookId"" = 0)");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void DeleteWhereTrackFileIsZero()
|
|
|
|
|
{
|
|
|
|
|
using (var mapper = _database.OpenConnection())
|
|
|
|
|
{
|
|
|
|
|
using var mapper = _database.OpenConnection();
|
|
|
|
|
mapper.Execute(@"DELETE FROM ""MetadataFiles""
|
|
|
|
|
WHERE ""Id"" IN (
|
|
|
|
|
SELECT ""Id"" FROM ""MetadataFiles""
|
|
|
|
@ -85,5 +76,4 @@ namespace NzbDrone.Core.Housekeeping.Housekeepers
|
|
|
|
|
AND ""BookFileId"" = 0)");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|