예제 #1
0
        public void AddChannel()
        {
            //Add channel 'rtlz' with url 'rtp://224.0.251.115:8230' to TvHeadend
            TvhCommunication Factory() => new TvhCommunication(_logger, _settings);

            var model = new TvhModel(_logger, _settings, Factory);

            model.ReadFromWeb();

            model.AddChannel(8, "rtlz", "rtp://224.0.251.115:8230", true);
        }
예제 #2
0
 private void UpdateTvhConfiguration(TvHeadendChannelUpdate tcu)
 {
     if (string.IsNullOrWhiteSpace(tcu.TvhId))
     {
         _configuration.AddChannel(tcu.Number, tcu.Name, tcu.NewUrl, tcu.Epg);
     }
     else if (string.IsNullOrWhiteSpace(tcu.NewUrl))
     {
         _configuration.RemoveChannel(tcu.TvhId, tcu.Name);
     }
     else
     {
         _configuration.UpdateChannel(tcu.TvhId, tcu.Name, tcu.NewUrl, tcu.Epg);
     }
 }