Ejemplo n.º 1
0
        public static List<EpgListing> LoadEpgListings(int UserOid, int[] ChannelOids, IEnumerable<NUtility.EPGEvent> Data, RecordingDirectory UserDefault = null)
        {
            Stopwatch timer = new Stopwatch();
            timer.Start();
            Logger.Log("Loading EPG Listings [0]: " + timer.Elapsed);
            var config = new Configuration();
            if(UserDefault == null)
                UserDefault = RecordingDirectory.LoadUserDefault(UserOid);

            var allowedRecordings = EpgRecordingData.LoadAllowedRecordings(UserOid);
            Logger.Log("Loading EPG Listings [2]: " + timer.Elapsed);

            timer.Stop();
            return Data.Select(x =>
            {
                var listing = new EpgListing(x);
                if (allowedRecordings.ContainsKey(x.OID))
                {
                    listing.PrePadding = allowedRecordings[x.OID].PrePadding;
                    listing.PostPadding = allowedRecordings[x.OID].PostPadding;
                    listing.RecordingDirectoryId = allowedRecordings[x.OID].RecordingDirectoryId;
                    listing.Keep = allowedRecordings[x.OID].Keep;
                    listing.IsRecurring = allowedRecordings[x.OID].IsRecurring;
                    listing.RecordingType = allowedRecordings[x.OID].RecordingType;
                    listing.RecordingOid = allowedRecordings[x.OID].RecordingOid;
                    listing.IsRecording = true;
                }
                else
                {
                    listing.PrePadding = config.PrePadding;
                    listing.PostPadding = config.PostPadding;
                    listing.RecordingDirectoryId = UserDefault == null ? null : UserDefault.RecordingDirectoryId;
                }
                return listing;
            }).ToList();
        }
Ejemplo n.º 2
0
 public SearchResult(Channel Channel, EpgListing Listing)
 {
     this.Channel = Channel;
     this.Listing = Listing;
 }