mirror of
https://github.com/Radarr/Radarr
synced 2024-12-26 17:59:14 +00:00
Fixed broken migration 036 for people upgrading from very old DBs
This commit is contained in:
parent
aadd9243a4
commit
86aba08289
1 changed files with 19 additions and 4 deletions
|
@ -83,14 +83,18 @@ private void ConvertQualityModel(IDbConnection conn, IDbTransaction tran, string
|
|||
{
|
||||
var qualityJson = qualityModelReader.GetString(0);
|
||||
|
||||
QualityModel036 quality;
|
||||
SourceQualityModel036 sourceQuality;
|
||||
|
||||
if (!Json.TryDeserialize<QualityModel036>(qualityJson, out quality))
|
||||
if (!Json.TryDeserialize<SourceQualityModel036>(qualityJson, out sourceQuality))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
var qualityNewJson = qualityModelConverter.ToDB(quality);
|
||||
var qualityNewJson = qualityModelConverter.ToDB(new DestinationQualityModel036
|
||||
{
|
||||
Quality = sourceQuality.Quality.Id,
|
||||
Proper = sourceQuality.Proper
|
||||
});
|
||||
|
||||
using (IDbCommand updateCmd = conn.CreateCommand())
|
||||
{
|
||||
|
@ -106,10 +110,21 @@ private void ConvertQualityModel(IDbConnection conn, IDbTransaction tran, string
|
|||
}
|
||||
}
|
||||
|
||||
private class QualityModel036
|
||||
private class DestinationQualityModel036
|
||||
{
|
||||
public Int32 Quality { get; set; }
|
||||
public Boolean Proper { get; set; }
|
||||
}
|
||||
|
||||
private class SourceQualityModel036
|
||||
{
|
||||
public SourceQuality036 Quality { get; set; }
|
||||
public Boolean Proper { get; set; }
|
||||
}
|
||||
|
||||
private class SourceQuality036
|
||||
{
|
||||
public Int32 Id { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue