Also potentially update language and tags
This commit is contained in:
parent
1f5d49245d
commit
4cbd3c4b5a
|
@ -53,7 +53,8 @@ namespace NzbDrone.Core.Test.Datastore.Migration
|
||||||
Added = now,
|
Added = now,
|
||||||
LastUpdated = now,
|
LastUpdated = now,
|
||||||
Extension = Path.GetExtension(subtitlePath),
|
Extension = Path.GetExtension(subtitlePath),
|
||||||
Language = 1
|
Language = 10,
|
||||||
|
LanguageTags = new List<string> { "sdh" }.ToJson()
|
||||||
});
|
});
|
||||||
|
|
||||||
c.Insert.IntoTable("EpisodeFiles").Row(new
|
c.Insert.IntoTable("EpisodeFiles").Row(new
|
||||||
|
@ -75,6 +76,8 @@ namespace NzbDrone.Core.Test.Datastore.Migration
|
||||||
|
|
||||||
files.First().Title.Should().Be(title);
|
files.First().Title.Should().Be(title);
|
||||||
files.First().Copy.Should().Be(copy);
|
files.First().Copy.Should().Be(copy);
|
||||||
|
files.First().LanguageTags.Should().NotContain("sdh");
|
||||||
|
files.First().Language.Should().NotBe(10);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
|
using System.Text.Json;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
using Dapper;
|
using Dapper;
|
||||||
using FluentMigrator;
|
using FluentMigrator;
|
||||||
using NzbDrone.Core.Datastore.Migration.Framework;
|
using NzbDrone.Core.Datastore.Migration.Framework;
|
||||||
|
@ -49,7 +51,17 @@ namespace NzbDrone.Core.Datastore.Migration
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var updateSubtitleFilesSql = "UPDATE \"SubtitleFiles\" SET \"Title\" = @Title, \"Copy\" = @Copy, \"LastUpdated\" = CURRENT_TIMESTAMP WHERE \"Id\" = @Id";
|
var serializerSettings = new JsonSerializerOptions
|
||||||
|
{
|
||||||
|
AllowTrailingCommas = true,
|
||||||
|
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
|
||||||
|
PropertyNameCaseInsensitive = true,
|
||||||
|
DictionaryKeyPolicy = JsonNamingPolicy.CamelCase,
|
||||||
|
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
|
||||||
|
WriteIndented = true
|
||||||
|
};
|
||||||
|
|
||||||
|
var updateSubtitleFilesSql = "UPDATE \"SubtitleFiles\" SET \"Title\" = @Title, \"Copy\" = @Copy, \"Language\" = @Language, \"LanguageTags\" = @LanguageTags, \"LastUpdated\" = CURRENT_TIMESTAMP WHERE \"Id\" = @Id";
|
||||||
conn.Execute(updateSubtitleFilesSql, updates, transaction: tran);
|
conn.Execute(updateSubtitleFilesSql, updates, transaction: tran);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue