Example #1
0
        public static IList<Channel> ListAll() 
        {
            
            //in tv server setup
            //Log.Debug("listing all channels");

            IList<Mediaportal.TV.Server.TVDatabase.Entities.Channel> rawchannels;
            if (TvWishListSetup.Setup)
                rawchannels = ServiceAgents.Instance.ChannelServiceAgent.ListAllChannelsByMediaType(Mediaportal.TV.Server.TVDatabase.Entities.Enums.MediaTypeEnum.TV);
            else
                rawchannels = ChannelManagement.ListAllChannelsByMediaType(Mediaportal.TV.Server.TVDatabase.Entities.Enums.MediaTypeEnum.TV);

            //Log.Debug(rawchannels.Count.ToString() + " channels found");          
            IList<Channel> allchannels = new List<Channel>();
            foreach (Mediaportal.TV.Server.TVDatabase.Entities.Channel mychannel in rawchannels)
            {
                Channel newchannel = new Channel();
                newchannel.IdChannel = mychannel.IdChannel;
                newchannel.DisplayName = mychannel.DisplayName;
                //add whatever you need here
                allchannels.Add(newchannel);
            }
            //Log.Debug(allchannels.Count.ToString() + " converted channels found");
            return allchannels;

        }
Example #2
0
        public static IList<Channel> ListAllByGroup(int groupId)
        {


            IList<Mediaportal.TV.Server.TVDatabase.Entities.Channel> rawchannels;
            if (TvWishListSetup.Setup)
                rawchannels = ServiceAgents.Instance.ChannelServiceAgent.GetAllChannelsByGroupIdAndMediaType(groupId, Mediaportal.TV.Server.TVDatabase.Entities.Enums.MediaTypeEnum.TV);
            else
                rawchannels = ChannelManagement.GetAllChannelsByGroupIdAndMediaType(groupId, Mediaportal.TV.Server.TVDatabase.Entities.Enums.MediaTypeEnum.TV);

            IList<Channel> allchannels = new List<Channel>();
            foreach (Mediaportal.TV.Server.TVDatabase.Entities.Channel mychannel in rawchannels)
            {
                Channel newchannel = new Channel();
                newchannel.IdChannel = mychannel.IdChannel;
                newchannel.DisplayName = mychannel.DisplayName;
                //add whatever you need here
                allchannels.Add(newchannel);
            }
            return allchannels;

        }
Example #3
0
        public static Channel Retrieve(int idChannel)
        {
            Mediaportal.TV.Server.TVDatabase.Entities.Channel mychannel;
            if (TvWishListSetup.Setup)
                mychannel = ServiceAgents.Instance.ChannelServiceAgent.GetChannel(idChannel);
            else
                mychannel = ChannelManagement.GetChannel(idChannel);

            Channel newchannel = new Channel();
            newchannel.IdChannel = mychannel.IdChannel;
            newchannel.DisplayName = mychannel.DisplayName;
            //add whatever you need here
            return newchannel;
        }