示例#1
0
        public bool GetChannelGroups(out IList <IChannelGroup> groups)
        {
            IChannelGroupService channelGroupService = GlobalServiceProvider.Get <IChannelGroupService>();

            groups = channelGroupService.ListAllChannelGroups()
                     .Select(tvGroup => tvGroup.ToChannelGroup())
                     .ToList();
            return(true);
        }
示例#2
0
        public bool GetChannels(IChannelGroup group, out IList <IChannel> channels)
        {
            IChannelGroupService channelGroupService = GlobalServiceProvider.Get <IChannelGroupService>();

            channels = channelGroupService.GetChannelGroup(group.ChannelGroupId).GroupMaps
                       .Select(groupMap => groupMap.Channel.ToChannel())
                       .ToList();
            return(true);
        }
示例#3
0
        public override Task <AsyncResult <IList <IChannel> > > GetChannelsAsync(IChannelGroup group)
        {
            IChannelGroupService channelGroupService = GlobalServiceProvider.Instance.Get <IChannelGroupService>();
            var channels = channelGroupService.GetChannelGroup(group.ChannelGroupId).GroupMaps
                           .Where(groupMap => groupMap.Channel.VisibleInGuide)
                           .OrderBy(groupMap => groupMap.SortOrder)
                           .Select(groupMap => groupMap.Channel.ToChannel())
                           .ToList();

            return(Task.FromResult(new AsyncResult <IList <IChannel> >(true, channels)));
        }
示例#4
0
        public bool GetProgramsGroup(IChannelGroup channelGroup, DateTime from, DateTime to, out IList <IProgram> programs)
        {
            IProgramService      programService      = GlobalServiceProvider.Get <IProgramService>();
            IChannelGroupService channelGroupService = GlobalServiceProvider.Get <IChannelGroupService>();

            var channels = channelGroupService.GetChannelGroup(channelGroup.ChannelGroupId).GroupMaps.Select(groupMap => groupMap.Channel);
            IDictionary <int, IList <Program> > programEntities = programService.GetProgramsForAllChannels(from, to, channels);

            programs = programEntities.Values.SelectMany(x => x).Select(p => p.ToProgram()).ToList();
            return(programs.Count > 0);
        }
示例#5
0
        public override bool GetChannels(IChannelGroup group, out IList <IChannel> channels)
        {
            IChannelGroupService channelGroupService = GlobalServiceProvider.Instance.Get <IChannelGroupService>();

            channels = channelGroupService.GetChannelGroup(group.ChannelGroupId).GroupMaps
                       .Where(groupMap => groupMap.Channel.VisibleInGuide)
                       .OrderBy(groupMap => groupMap.SortOrder)
                       .Select(groupMap => groupMap.Channel.ToChannel())
                       .ToList();
            return(true);
        }
示例#6
0
        public override Task <AsyncResult <IList <IChannelGroup> > > GetChannelGroupsAsync()
        {
            IChannelGroupService channelGroupService = GlobalServiceProvider.Instance.Get <IChannelGroupService>();
            var groups = channelGroupService.ListAllChannelGroups()
                         .OrderBy(tvGroup => tvGroup.MediaType)
                         .ThenBy(tvGroup => tvGroup.SortOrder)
                         .Select(tvGroup => tvGroup.ToChannelGroup())
                         .ToList();

            return(Task.FromResult(new AsyncResult <IList <IChannelGroup> >(true, groups)));
        }
示例#7
0
        public override bool GetChannelGroups(out IList <IChannelGroup> groups)
        {
            IChannelGroupService channelGroupService = GlobalServiceProvider.Instance.Get <IChannelGroupService>();

            groups = channelGroupService.ListAllChannelGroups()
                     .OrderBy(tvGroup => tvGroup.MediaType)
                     .ThenBy(tvGroup => tvGroup.SortOrder)
                     .Select(tvGroup => tvGroup.ToChannelGroup())
                     .ToList();
            return(true);
        }
示例#8
0
        public override Task <AsyncResult <IList <IProgram> > > GetProgramsGroupAsync(IChannelGroup channelGroup, DateTime from, DateTime to)
        {
            IProgramService      programService      = GlobalServiceProvider.Instance.Get <IProgramService>();
            IChannelGroupService channelGroupService = GlobalServiceProvider.Instance.Get <IChannelGroupService>();

            var channels = channelGroupService.GetChannelGroup(channelGroup.ChannelGroupId).GroupMaps.Select(groupMap => groupMap.Channel);
            IDictionary <int, IList <Program> > programEntities = programService.GetProgramsForAllChannels(from, to, channels);

            var programs = programEntities.Values.SelectMany(x => x).Select(p => GetProgram(p)).Distinct(ProgramComparer.Instance).ToList();
            var success  = programs.Count > 0;

            return(Task.FromResult(new AsyncResult <IList <IProgram> >(success, programs)));
        }
示例#9
0
        public bool GetChannelGroups(out IList <IChannelGroup> groups)
        {
#if TVE3
            // TODO: only TV groups affected here
            groups = TvDatabase.ChannelGroup.ListAll()
                     .OrderBy(tvGroup => tvGroup.SortOrder)
#else
            IChannelGroupService channelGroupService = GlobalServiceProvider.Instance.Get <IChannelGroupService>();
            groups = channelGroupService.ListAllChannelGroups()
                     .OrderBy(tvGroup => tvGroup.MediaType)
                     .ThenBy(tvGroup => tvGroup.SortOrder)
#endif
                     .Select(tvGroup => tvGroup.ToChannelGroup())
                     .ToList();
            return(true);
        }
示例#10
0
        public bool GetChannels(IChannelGroup group, out IList <IChannel> channels)
        {
#if TVE3
            channels = _tvBusiness.GetChannelsInGroup(TvDatabase.ChannelGroup.Retrieve(group.ChannelGroupId))
                       // Bug? SortOrder contains logical channel number, not the group sort order?
                       // .OrderBy(c => c.SortOrder)
                       .Where(c => c.VisibleInGuide)
                       .Select(c => c.ToChannel())
                       .ToList();
#else
            IChannelGroupService channelGroupService = GlobalServiceProvider.Instance.Get <IChannelGroupService>();
            channels = channelGroupService.GetChannelGroup(group.ChannelGroupId).GroupMaps
                       .Where(groupMap => groupMap.Channel.VisibleInGuide)
                       .OrderBy(groupMap => groupMap.SortOrder)
                       .Select(groupMap => groupMap.Channel.ToChannel())
                       .ToList();
#endif
            return(true);
        }
示例#11
0
        public bool GetProgramsGroup(IChannelGroup channelGroup, DateTime from, DateTime to, out IList <IProgram> programs)
        {
#if TVE3
            programs = new List <IProgram>();
            foreach (var channel in _tvBusiness.GetTVGuideChannelsForGroup(channelGroup.ChannelGroupId))
            {
                CollectionUtils.AddAll(programs, _tvBusiness.GetPrograms(TvDatabase.Channel.Retrieve(channel.IdChannel), from, to).Select(p => p.ToProgram()));
            }
#else
            IProgramService      programService      = GlobalServiceProvider.Instance.Get <IProgramService>();
            IChannelGroupService channelGroupService = GlobalServiceProvider.Instance.Get <IChannelGroupService>();

            var channels = channelGroupService.GetChannelGroup(channelGroup.ChannelGroupId).GroupMaps.Select(groupMap => groupMap.Channel);
            IDictionary <int, IList <Program> > programEntities = programService.GetProgramsForAllChannels(from, to, channels);

            programs = programEntities.Values.SelectMany(x => x).Select(p => p.ToProgram()).Distinct(ProgramComparer.Instance).ToList();
#endif
            return(programs.Count > 0);
        }