static PublishSettings MigrateSettings(string bookFolderPath)
{
// See if we can migrate data from an old metaData.
var metaDataPath = BookMetaData.MetaDataPath(bookFolderPath);
var settings = new PublishSettings();
try
{
if (!RobustFile.Exists(metaDataPath))
{
return(settings);
}
var metaDataString = RobustFile.ReadAllText(metaDataPath, Encoding.UTF8);
// I chose to do this using DynamicJson, rather than just BloomMetaData.FromString() and
// reading the obsolete properties, in hopes that we can eventually retire the obsolete
// properties. However, that may not be possible without breaking things when we attempt
// to load an old meta.json with JsonConvert. Still, at least this approach makes for
// fewer warnings about use of obsolete methods.
var metaDataJson = DynamicJson.Parse(metaDataString) as DynamicJson;
if (metaDataJson.IsDefined("features"))
{
if (metaDataJson.TryGet("features", out string[] features))