static void Main7( string[] args ) { // Attach to job manager VCRServer server = new VCRServer( new DirectoryInfo( @"C:\temp\VCR.NET 3.9 Alpha\Jobs" ) ); JobManager jobs = server.JobManager; ProgramGuideEntries entries = new ProgramGuideEntries(); entries.Add( new ProgramGuideEntry { Name = "Te\x0005st" } ); SerializationTools.Save( entries, @"c:\temp\test.xml" ); ProgramGuideEntries reload = SerializationTools.Load<ProgramGuideEntries>( new FileInfo( @"c:\temp\test.xml" ) ); }
static void Main7(string[] args) { // Attach to job manager VCRServer server = new VCRServer(new DirectoryInfo(@"C:\temp\VCR.NET 3.9 Alpha\Jobs")); JobManager jobs = server.JobManager; ProgramGuideEntries entries = new ProgramGuideEntries(); entries.Add(new ProgramGuideEntry { Name = "Te\x0005st" }); SerializationTools.Save(entries, @"c:\temp\test.xml"); ProgramGuideEntries reload = SerializationTools.Load <ProgramGuideEntries>(new FileInfo(@"c:\temp\test.xml")); }
/// <summary> /// Erstellt für alle noch nicht berücksichtigten Aufzeichnungen Auszüge aus der Programmzeitschrift. /// </summary> /// <param name="recordings">Die Liste der Aufzeichnungen, die bearbeitet werden sollen.</param> private void RecordingPostProcessing(params VCRRecordingInfo[] recordings) { // Process all foreach (var recording in recordings) { // Report Tools.ExtendedLogging("Extracting EPGINFO for {0}", recording.Name); // Load bounds var from = recording.PhysicalStart.Value; var to = DateTime.UtcNow; // Create guide var entries = new ProgramGuideEntries(); // Fill it entries.AddRange( ProfileState .ProgramGuide .GetEntries(recording.Source.Source) .TakeWhile(e => e.StartTime < to) .Where(e => e.EndTime > from)); // Write it out SerializationTools.SafeSave(entries, Path.ChangeExtension(recording.FileName, "epginfo")); } // Detect all files related to the recordings var scheduleIdentifiers = new HashSet <Guid>(recordings.Select(recording => recording.ScheduleUniqueID.Value)); var files = m_files.Where(file => scheduleIdentifiers.Contains(new Guid(file.ScheduleIdentifier))); // Clone current environment var environment = new Dictionary <string, string>(ExtensionEnvironment); // Fill AddFilesToEnvironment(environment, "Recorded", files); // Process extensions FireRecordingFinishedExtensions(environment); }
/// <summary> /// Erstellt für alle noch nicht berücksichtigten Aufzeichnungen Auszüge aus der Programmzeitschrift. /// </summary> /// <param name="recordings">Die Liste der Aufzeichnungen, die bearbeitet werden sollen.</param> private void RecordingPostProcessing( params VCRRecordingInfo[] recordings ) { // Process all foreach (var recording in recordings) { // Report Tools.ExtendedLogging( "Extracting EPGINFO for {0}", recording.Name ); // Load bounds var from = recording.PhysicalStart.Value; var to = DateTime.UtcNow; // Create guide var entries = new ProgramGuideEntries(); // Fill it entries.AddRange( ProfileState .ProgramGuide .GetEntries( recording.Source.Source ) .TakeWhile( e => e.StartTime < to ) .Where( e => e.EndTime > from ) ); // Write it out SerializationTools.SafeSave( entries, Path.ChangeExtension( recording.FileName, "epginfo" ) ); } // Detect all files related to the recordings var scheduleIdentifiers = new HashSet<Guid>( recordings.Select( recording => recording.ScheduleUniqueID.Value ) ); var files = m_files.Where( file => scheduleIdentifiers.Contains( new Guid( file.ScheduleIdentifier ) ) ); // Clone current environment var environment = new Dictionary<string, string>( ExtensionEnvironment ); // Fill AddFilesToEnvironment( environment, "Recorded", files ); // Process extensions FireRecordingFinishedExtensions( environment ); }
/// <summary> /// Beendet die Sammlung endgültig. /// </summary> protected override void OnStop() { // At least we tried ProfileState.ProgramGuide.LastUpdateTime = DateTime.UtcNow; // Report Tools.ExtendedLogging("Converting Program Guide Entries from Card Server to VCR.NET Format"); // Create result var result = new ProgramGuideEntries(); // Fill it foreach (var item in Server.BeginEndEPGCollection().Result) { // Create event var epg = new ProgramGuideEntry { TransportIdentifier = item.Source.TransportStream, ShortDescription = item.ShortDescription, NetworkIdentifier = item.Source.Network, ServiceIdentifier = item.Source.Service, Description = item.Description, Duration = item.Duration, Language = item.Language, StartTime = item.Start, Name = item.Name }; // Finish if (item.Content != null) { epg.Categories.AddRange(item.Content.Select(c => c.ToString())); } if (item.Ratings != null) { epg.Ratings.AddRange(item.Ratings); } // Resolve var source = VCRProfiles.FindSource(ProfileName, item.Source); if (source == null) { // Load default epg.StationName = item.Source.ToString(); } else { // Attach to the station var station = (Station)source.Source; // Load names epg.StationName = station.Name; } // Add it result.Add(epg); } // Report ProfileState.ProgramGuide.UpdateGuide(result); }
/// <summary> /// Beendet die Sammlung endgültig. /// </summary> protected override void OnStop() { // At least we tried ProfileState.ProgramGuide.LastUpdateTime = DateTime.UtcNow; // Report Tools.ExtendedLogging( "Converting Program Guide Entries from Card Server to VCR.NET Format" ); // Create result var result = new ProgramGuideEntries(); // Fill it foreach (var item in Server.BeginEndEPGCollection().Result) { // Create event var epg = new ProgramGuideEntry { TransportIdentifier = item.Source.TransportStream, ShortDescription = item.ShortDescription, NetworkIdentifier = item.Source.Network, ServiceIdentifier = item.Source.Service, Description = item.Description, Duration = item.Duration, Language = item.Language, StartTime = item.Start, Name = item.Name }; // Finish if (item.Content != null) epg.Categories.AddRange( item.Content.Select( c => c.ToString() ) ); if (item.Ratings != null) epg.Ratings.AddRange( item.Ratings ); // Resolve var source = VCRProfiles.FindSource( ProfileName, item.Source ); if (source == null) { // Load default epg.StationName = item.Source.ToString(); } else { // Attach to the station var station = (Station) source.Source; // Load names epg.StationName = station.Name; } // Add it result.Add( epg ); } // Report ProfileState.ProgramGuide.UpdateGuide( result ); }