diff --git a/src/NzbDrone.Core/Datastore/Migration/140_add_alternative_titles_table.cs b/src/NzbDrone.Core/Datastore/Migration/140_add_alternative_titles_table.cs index 41fc0bd5d..a9d7c6918 100644 --- a/src/NzbDrone.Core/Datastore/Migration/140_add_alternative_titles_table.cs +++ b/src/NzbDrone.Core/Datastore/Migration/140_add_alternative_titles_table.cs @@ -34,39 +34,6 @@ protected override void MainDbUpgrade() Alter.Table("Movies").AddColumn("SecondaryYear").AsInt32().Nullable(); Alter.Table("Movies").AddColumn("SecondaryYearSourceId").AsInt64().Nullable().WithDefault(0); - - Execute.WithConnection(AddExisting); - } - - private void AddExisting(IDbConnection conn, IDbTransaction tran) - { - using (IDbCommand getSeriesCmd = conn.CreateCommand()) - { - getSeriesCmd.Transaction = tran; - getSeriesCmd.CommandText = @"SELECT Key, Value FROM Config WHERE Key = 'importexclusions'"; - TextInfo textInfo = new CultureInfo("en-US", false).TextInfo; - using (IDataReader seriesReader = getSeriesCmd.ExecuteReader()) - { - while (seriesReader.Read()) - { - var Key = seriesReader.GetString(0); - var Value = seriesReader.GetString(1); - - var importExclusions = Value.Split(',').Select(x => { - return string.Format("(\"{0}\", \"{1}\")", Regex.Replace(x, @"^.*\-(.*)$", "$1"), - textInfo.ToTitleCase(string.Join(" ", x.Split('-').DropLast(1)))); - }).ToList(); - - using (IDbCommand updateCmd = conn.CreateCommand()) - { - updateCmd.Transaction = tran; - updateCmd.CommandText = "INSERT INTO ImportExclusions (tmdbid, MovieTitle) VALUES " + string.Join(", ", importExclusions); - - updateCmd.ExecuteNonQuery(); - } - } - } - } } } } \ No newline at end of file