/[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/15 16:53:40	163
+++ trunk/GBPVRProgramDatabaseFixer/SQLLITE.cs	2013/03/15 16:57:50	164
@@ -15,7 +15,7 @@
         List<SQLLITE.IRECORDING_SCHEDULE> Recordings { get; }
         List<SQLLITE.ICHANNEL> Channels { get; }
         IDateTimeRange GetProgramsDateRange(List<SQLLITE.IPROGRAMME> programs);
-        List<SQLLITE.IPROGRAMME> FilterProgramsByDateRange(List<SQLLITE.IPROGRAMME> programs, IDateTimeRange range);
+        List<SQLLITE.IPROGRAMME> FilterProgramsByDateRange(List<SQLLITE.IPROGRAMME> programs, IDateTimeRange range, out List<SQLLITE.IPROGRAMME> removed_programs);
 
     }
     public class SQLLITE : ISQLLITE
@@ -276,8 +276,9 @@
             return range;
         }
 
-        public List<SQLLITE.IPROGRAMME> FilterProgramsByDateRange(List<SQLLITE.IPROGRAMME> programs, IDateTimeRange range)
+        public List<SQLLITE.IPROGRAMME> FilterProgramsByDateRange(List<SQLLITE.IPROGRAMME> programs, IDateTimeRange range, out List<SQLLITE.IPROGRAMME> removed_programs)
         {
+            removed_programs = new List<IPROGRAMME>();
             List<SQLLITE.IPROGRAMME> list = new List<IPROGRAMME>(programs.ToArray());
             list = list.OrderBy(s => s.start_time).ToList();
             List<SQLLITE.IPROGRAMME> list2 = new List<IPROGRAMME>();
@@ -290,13 +291,18 @@
            
             foreach (var program in list)
             {
-                if (program.start_time >= range.Start && 
+                if (program.start_time >= range.Start &&
                     program.start_time <= range.End)
                 {
                     list2.Add(program);
                 }
+                else
+                {
+                    removed_programs.Add(program);
+                }
             }
             list2 = list2.OrderBy(s => s.channel_oid).ThenBy(s => s.start_time).ToList();
+            removed_programs = removed_programs.OrderBy(s => s.channel_oid).ThenBy(s => s.start_time).ToList();
             return list2;
         }
         #endregion

 

  ViewVC Help
Powered by ViewVC 1.1.22