/[xmltv_parser]/trunk/GBPVRProgramDatabaseFixer/SQLLITE.cs
ViewVC logotype

Diff of /trunk/GBPVRProgramDatabaseFixer/SQLLITE.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/GBPVRProgramDatabaseFixer/SQLLITE.cs	2013/03/16 22:36:18	202
+++ trunk/GBPVRProgramDatabaseFixer/SQLLITE.cs	2013/03/16 22:44:28	203
@@ -300,7 +300,7 @@
             public const string PROGRAMME = "PROGRAMME";
             public const string CHANNEL = "CHANNEL";
         }
-
+        private string DATABASE_BACKUP_FILE = string.Empty;
         //public SQLLite() { }
         protected SQLLITE(string database, EventHandler<EventArgs> OnInstanceCreated)
         {
@@ -658,6 +658,7 @@
                 gLog.Info.WriteLine("\tDestination: {0}", backup_file);
 
                 System.IO.File.Copy(this.Database, backup_file);
+                DATABASE_BACKUP_FILE = backup_file;
                 return true;
             }
             catch (Exception ex)
@@ -852,23 +853,23 @@
 
             double total = programs.Count;
             double index = 0;
-            double progress = 0;
+            //double progress = 0;
             Stopwatch st1 = new Stopwatch();
             st1.Start();
             foreach (var p in ChunkList)
             {
-                Stopwatch st2 = new Stopwatch();
-                st2.Start();
-                progress = 100.0 * (index / total);
+                //Stopwatch st2 = new Stopwatch();
+                //st2.Start();
+                //progress = 100.0 * (index / total);
                 gLog.Warn.WriteLine("Inserting {0} gbpvr programs ({1} of {2})", p.Count(), index, total);   
                 if (!InsertProgramEntryDatabase(p))
                 {
                     gLog.Error.WriteLine("Failed to insert one or more program(s)");
                 }
-                st2.Stop();
-                gLog.Warn.WriteLine("    operation took: {0:0.00000} seconds", st2.Elapsed.TotalSeconds);
-                gLog.Warn.WriteLine(System.Environment.NewLine);
-                gLog.ReportProgress(this, new ReportProgressEventArgs((int)progress, string.Format("Inserting GBPVR Programs: {0:00}%", (int)progress)));
+                //st2.Stop();
+                //gLog.Warn.WriteLine("    operation took: {0:0.00000} seconds", st2.Elapsed.TotalSeconds);
+                //gLog.Warn.WriteLine(System.Environment.NewLine);
+                //gLog.ReportProgress(this, new ReportProgressEventArgs((int)progress, string.Format("Inserting GBPVR Programs: {0:00}%", (int)progress)));
                 index += (double)p.Count();                
             }
             st1.Stop();

 

  ViewVC Help
Powered by ViewVC 1.1.22