|
|
|
@ -23,8 +23,7 @@ namespace NzbDrone.Core.Housekeeping.Housekeepers
|
|
|
|
|
|
|
|
|
|
private void DeleteOrphanedByArtist()
|
|
|
|
|
{
|
|
|
|
|
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"".""ArtistId"" = ""Artists"".""Id""
|
|
|
|
|
WHERE ""Artists"".""Id"" IS NULL)");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void DeleteOrphanedByAlbum()
|
|
|
|
|
{
|
|
|
|
|
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"".""AlbumId"" > 0
|
|
|
|
|
AND ""Albums"".""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"".""TrackFileId"" > 0
|
|
|
|
|
AND ""TrackFiles"".""Id"" IS NULL)");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void DeleteWhereAlbumIdIsZero()
|
|
|
|
|
{
|
|
|
|
|
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 (4, 6)
|
|
|
|
|
AND ""AlbumId"" = 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""
|
|
|
|
@ -86,4 +77,3 @@ namespace NzbDrone.Core.Housekeeping.Housekeepers
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|