Skip to content

Commit

Permalink
Housekeeper to migrate deemix branch
Browse files Browse the repository at this point in the history
  • Loading branch information
ta264 committed Dec 21, 2020
1 parent 90b5c95 commit ced69ef
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Dapper;
using NzbDrone.Core.Datastore;

namespace NzbDrone.Core.Housekeeping.Housekeepers
{
public class FixDeemixDelayProfile : IHousekeepingTask
{
private readonly IMainDatabase _database;

public FixDeemixDelayProfile(IMainDatabase database)
{
_database = database;
}

public void Clean()
{
using (var mapper = _database.OpenConnection())
{
mapper.Execute(@"UPDATE DelayProfiles
SET Items = REPLACE(Items, 'usenet', 'UsenetDownloadProtocol')");
mapper.Execute(@"UPDATE DelayProfiles
SET Items = REPLACE(Items, 'torrent', 'TorrentDownloadProtocol')");
mapper.Execute(@"UPDATE DelayProfiles
SET Items = REPLACE(Items, 'deemix', 'DeemixDownloadProtocol')");
}
}
}
}

0 comments on commit ced69ef

Please sign in to comment.