//Updated August 6th public static void InsertImdbEntry(ImdbElement imdbElement) { try { MongoUtils.GetMongoCollection ( @"mongodb://" + ConfigurationManager.AppSettings["mongoHost"] + @"/", ConfigurationManager.AppSettings["port"], ConfigurationManager.AppSettings["db"], ConfigurationManager.AppSettings["movie_collection"] ).Insert(new Movie() { ImdbCode = imdbElement.Id, ImdbTitle = imdbElement.Title, Year = Regex.Replace(imdbElement.TitleDescription, "[^0-9.+-]", "").ToInt(), Urls = new List <string>() { "http://www.imdb.com/" + imdbElement.Id }, Downloaded = false }); } catch (Exception e) { Log.AppendToLog("Error : FATAL write from IMDB to Mongo. " + e, ConfigurationManager.AppSettings["log_file"]); } }
//Updated August 6th public static void InsertImdbEntry(ImdbElement imdbElement) { try { MongoUtils.GetMongoCollection ( @"mongodb://" + ConfigurationManager.AppSettings["mongoHost"] + @"/", ConfigurationManager.AppSettings["port"], ConfigurationManager.AppSettings["db"], ConfigurationManager.AppSettings["movie_collection"] ).Insert(new Movie() { ImdbCode = imdbElement.Id, ImdbTitle = imdbElement.Title, Year = Regex.Replace(imdbElement.TitleDescription, "[^0-9.+-]", "").ToInt(), Urls = new List<string>() {"http://www.imdb.com/" + imdbElement.Id}, Downloaded = false }); } catch (Exception e) { Log.AppendToLog("Error : FATAL write from IMDB to Mongo. " + e, ConfigurationManager.AppSettings["log_file"]); } }