Cleaned up 2160p changes and added migration and tests.

Also reserved the quality ids for WEBRip etc.
This commit is contained in:
Taloth Saldono
2016-02-06 11:33:59 +01:00
parent 94323f79e7
commit f25f5abced
7 changed files with 94 additions and 21 deletions
@@ -0,0 +1,35 @@
using System.Collections.Generic;
using System.Data;
using System.Linq;
using FluentMigrator;
using NzbDrone.Common.Serializer;
using NzbDrone.Core.Datastore.Migration.Framework;
namespace NzbDrone.Core.Datastore.Migration
{
[Migration(101)]
public class add_ultrahd_quality_in_profiles : NzbDroneMigrationBase
{
protected override void MainDbUpgrade()
{
Execute.WithConnection(ConvertProfile);
}
private void ConvertProfile(IDbConnection conn, IDbTransaction tran)
{
var updater = new ProfileUpdater70(conn, tran);
updater.AppendQuality(16); // HDTV2160p
updater.AppendQuality(18); // WEBDL2160p
updater.AppendQuality(19); // Bluray2160p
updater.Commit();
// WEBRip migrations.
//updater.SplitQualityAppend(1, 11); // HDTV480p after SDTV
//updater.SplitQualityPrepend(8, 12); // WEBRip480p before WEBDL480p
//updater.SplitQualityAppend(2, 13); // Bluray480p after DVD
//updater.SplitQualityPrepend(5, 14); // WEBRip720p before WEBDL720p
//updater.SplitQualityPrepend(3, 15); // WEBRip1080p before WEBDL1080p
//updater.SplitQualityPrepend(18, 17); // WEBRip2160p before WEBDL2160p
}
}
}