public IActionResult Create(FavoriteChannelViewModel favoriteChannel)
        {
            // Test for a pre-existing channel!
            var fcx = j64Config.FavoriteChannels.Find(x => x.Channel == favoriteChannel.ChannelNumber);
            if (fcx != null)
                ModelState.AddModelError("ChannelNumber", "This channel number already exists");

            fcx = j64Config.FavoriteChannels.Find(x => x.Name == favoriteChannel.Name);
            if (fcx != null)
                ModelState.AddModelError("Name", "This channel name already exists");

            if (ModelState.IsValid == false)
                return View(favoriteChannel);

            // Add this channel to the config
            j64Config.FavoriteChannels.Add(new FavoriteChannel()
            {
                Channel = favoriteChannel.ChannelNumber,
                Name = favoriteChannel.Name
            });
            j64HarmonyGatewayRepository.Save(j64Config);

            // Return to the list
            return RedirectToAction("Index");
        }
        public IActionResult Edit(FavoriteChannelViewModel favoriteChannel)
        {
            var hubFc = j64Config.FavoriteChannels.Find(x => x.Channel == favoriteChannel.ChannelNumber);
            if (hubFc == null)
                ModelState.AddModelError("ChannelNumber", "This channel no longer exists");

            var hubFcn = j64Config.FavoriteChannels.Find(x => x.Name == favoriteChannel.Name);
            if (hubFcn != null)
                ModelState.AddModelError("Name", "This channel name already exists");


            if (ModelState.IsValid == false)
                return View(favoriteChannel);

            hubFc.Name = favoriteChannel.Name;
            j64HarmonyGatewayRepository.Save(j64Config);

            return RedirectToAction("Index");
        }
        public IActionResult Edit(string channel)
        {
            if (channel == null)
                return NotFound();

            var hubFc = j64Config.FavoriteChannels.Find(x => x.Channel == channel);
            if (hubFc == null)
                return NotFound();

            // Return the view model entry
            FavoriteChannelViewModel fc = new FavoriteChannelViewModel()
            {
                ChannelNumber = hubFc.Channel,
                Name = hubFc.Name
            };

            return View(fc);
        }