/[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/17 01:15:17	216
+++ trunk/GBPVRProgramDatabaseFixer/SQLLITE.cs	2013/03/17 01:23:45	217
@@ -824,34 +824,9 @@
 
         public void RemoveOldGBPVRPrograms(List<SQLLITE.IPROGRAMME> programs)
         {            
-            //gLog.Info.WriteLine("Removing {0} gbpvr programs.", programs.Count);
-            //double total = programs.Count;
-            //double index = 0;
-            //double progress = 0;
-            //Stopwatch st = new Stopwatch();
-            //st.Start();
-            //foreach (var program in programs)
-            //{
-            //    progress = 100.0 * (index / total);
-            //    gLog.ReportProgress(this, new ReportProgressEventArgs((int)progress, string.Format("Removing GBPVR Program ({0:00}%) oid='{1}'", (int)progress, program.oid)));
-            //    if (!RemoveProgramDatabaseEntry(program))
-            //    {
-            //        gLog.Error.WriteLine("Failed to remove program with oid: {0}", program.oid);
-            //    }
-            //    index++;
-            //}
-            ////Stopwatch st = new Stopwatch();
-            ////st.Start();
-            ////if (!RemoveAllProgramDatabaseEntries())
-            ////{
-            ////    gLog.Error.WriteLine("Failed to remove one or more program(s)");
-            ////}
-            //st.Stop();
-            //gLog.Warn.WriteLine("    operation took: {0:0.00000} seconds", st.Elapsed.TotalSeconds);
-
-            int ChunkSize = 1024;
+            gLog.Info.WriteLine("Removing {0} gbpvr programs.", programs.Count);
+            int ChunkSize = 1;
             var ChunkList = programs.Chunk<IPROGRAMME>(ChunkSize);
-
             double total = programs.Count;
             double index = 0;
             double progress = 0;
@@ -872,7 +847,8 @@
         }
         public void UpdateGBPVRPrograms(List<IOldNewProgram> programs)
         {
-            int ChunkSize = 1024;
+            gLog.Info.WriteLine("Updating {0} gbpvr programs.", programs.Count);
+            int ChunkSize = 1;
             var ChunkList = programs.Chunk<IOldNewProgram>(ChunkSize);
 
             double total = programs.Count;
@@ -882,17 +858,11 @@
             st1.Start();
             foreach (var p in ChunkList)
             {
-                //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 (!UpdateProgramEntryDatabase(p))
                 {
                     gLog.Error.WriteLine("Failed to update 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("Updating {0} gbpvr programs ({1} of {2}) {3:00}%", p.Count(), index, total, (int)progress)));
                 index += (double)p.Count();                
             }

 

  ViewVC Help
Powered by ViewVC 1.1.22