mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-28 13:01:28 +02:00
Remove old housekeepers
This commit is contained in:
@@ -1,32 +0,0 @@
|
|||||||
using Dapper;
|
|
||||||
using NzbDrone.Core.Datastore;
|
|
||||||
|
|
||||||
namespace NzbDrone.Core.Housekeeping.Housekeepers
|
|
||||||
{
|
|
||||||
public class CleanupAbsolutePathMetadataFiles : IHousekeepingTask
|
|
||||||
{
|
|
||||||
private readonly IMainDatabase _database;
|
|
||||||
|
|
||||||
public CleanupAbsolutePathMetadataFiles(IMainDatabase database)
|
|
||||||
{
|
|
||||||
_database = database;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Clean()
|
|
||||||
{
|
|
||||||
using (var mapper = _database.OpenConnection())
|
|
||||||
{
|
|
||||||
mapper.Execute(@"DELETE FROM MetadataFiles
|
|
||||||
WHERE Id IN (
|
|
||||||
SELECT Id FROM MetadataFiles
|
|
||||||
WHERE RelativePath
|
|
||||||
LIKE '_:\%'
|
|
||||||
OR RelativePath
|
|
||||||
LIKE '\%'
|
|
||||||
OR RelativePath
|
|
||||||
LIKE '/%'
|
|
||||||
)");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@@ -1,26 +0,0 @@
|
|||||||
using Dapper;
|
|
||||||
using NzbDrone.Core.Datastore;
|
|
||||||
|
|
||||||
namespace NzbDrone.Core.Housekeeping.Housekeepers
|
|
||||||
{
|
|
||||||
public class CleanupAdditionalNamingSpecs : IHousekeepingTask
|
|
||||||
{
|
|
||||||
private readonly IMainDatabase _database;
|
|
||||||
|
|
||||||
public CleanupAdditionalNamingSpecs(IMainDatabase database)
|
|
||||||
{
|
|
||||||
_database = database;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Clean()
|
|
||||||
{
|
|
||||||
using (var mapper = _database.OpenConnection())
|
|
||||||
{
|
|
||||||
mapper.Execute(@"DELETE FROM NamingConfig
|
|
||||||
WHERE ID NOT IN (
|
|
||||||
SELECT ID FROM NamingConfig
|
|
||||||
LIMIT 1)");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Reference in New Issue
Block a user