} // GetProviders protected IList <BroadcastList> GetBroadcastList(IEnumerable <UiServiceProvider> providers) { var result = new List <BroadcastList>(); foreach (var provider in providers) { AddResult(Severity.Info, "Loading broadcast data", provider.DisplayName); var downloader = new UiBroadcastDiscoveryDownloader(); var uiDiscovery = downloader.Download(Owner, provider, null, true, null); if (uiDiscovery == null) { AddResult(Severity.Error, "Missing broadcast data", provider.DisplayName); return(null); } // if result.Add(new BroadcastList() { Provider = provider, Services = uiDiscovery.Services.AsReadOnly() }); } // foreach return(result.AsReadOnly()); } // GetBroadcastList
} // Run private bool Init() { // load configuration var result = AppUiConfiguration.Load(null, Console.WriteLine); if (result.IsError) { Console.WriteLine(result.Message); return(false); } // if // get channels Console.WriteLine("Loading broadcast services"); var providers = AppUiConfiguration.Current.Cache.LoadXml <ProviderDiscoveryRoot>("ProviderDiscovery", AppUiConfiguration.Current.ContentProvider.Bootstrap.MulticastAddress); ServiceProvider = UiProviderDiscovery.GetUiServiceProviderFromKey(providers, "dem_19.imagenio.es"); var downloader = new UiBroadcastDiscoveryDownloader(); BroadcastDiscovery = downloader.Download(null, ServiceProvider, null, true); ParentalGuidanceCodes = new Dictionary <string, string>(); EpgServices = new Dictionary <string, EpgService>(); return(true); } // Init
} // SelectProvider private bool LoadBroadcastDiscovery() { var downloader = new UiBroadcastDiscoveryDownloader(); var uiDiscovery = downloader.Download(this, SelectedServiceProvider, BroadcastDiscovery, checkFromCache.Checked, checkHighDefPriority.Checked); if (uiDiscovery == null) { return(false); } BroadcastDiscovery = uiDiscovery; return(true); } // LoadBroadcastDiscovery
} // IsScanActive private bool LoadBroadcastDiscovery(bool fromCache) { var downloader = new UiBroadcastDiscoveryDownloader(); downloader.AfterCacheLoad += (sender, e) => { if (e.CachedDiscovery == null) { Notify(Properties.Resources.Error_24x24, Properties.Texts.ChannelListNoCache, 60000); } else { NotifyChannelListAge((int)e.CachedDiscovery.Age.TotalDays); } // if }; downloader.Exception += MyApplication.HandleException; var uiDiscovery = downloader.Download(this, SelectedServiceProvider, BroadcastDiscovery, fromCache); if (uiDiscovery == null) { return(false); } ShowEpgMiniGuide(false); SetBroadcastDiscovery(uiDiscovery); if (fromCache) { if (BroadcastDiscovery.Services.Count <= 0) { Notify(Properties.Resources.Info_24x24, Properties.Texts.ChannelListCacheEmpty, 30000); } // if } // if-else return(true); } // LoadBroadcastDiscovery