Exemplo n.º 1
0
        public async Task <ChannelItemResult> GetChannelItems(InternalChannelItemQuery query, CancellationToken cancellationToken)
        {
            var menu = new MenuSystem(_httpClient, _jsonSerializer, _logger);

            _logger.Debug("cat ID : " + query.FolderId);

            if (query.FolderId == null)
            {
                return(await menu.GetMainMenu(cancellationToken).ConfigureAwait(false));
            }

            var folderID = query.FolderId.Split('_');

            query.FolderId = folderID[1];

            if (folderID[0] == "video")
            {
                return(await GetVideos(query, cancellationToken).ConfigureAwait(false));
            }
            if (folderID[0] == "tvChannels")
            {
                return(await menu.GetTVChannels(cancellationToken).ConfigureAwait(false));
            }
            if (folderID[0] == "categories")
            {
                return(await menu.GetCategories("", "", cancellationToken).ConfigureAwait(false));
            }
            if (folderID[0] == "category")
            {
                return(await menu.GetCategory(query.FolderId, "", cancellationToken).ConfigureAwait(false));
            }
            if (folderID[0] == "a-z")
            {
                return(await menu.GetAToZ(cancellationToken).ConfigureAwait(false));
            }


            return(null);
        }
Exemplo n.º 2
0
        public async Task<ChannelItemResult> GetChannelItems(InternalChannelItemQuery query, CancellationToken cancellationToken)
        {
            var menu = new MenuSystem(_httpClient, _jsonSerializer, _logger);

            _logger.Debug("cat ID : " + query.FolderId);

            if (query.FolderId == null)
            {
                return await menu.GetMainMenu(cancellationToken).ConfigureAwait(false);
            }
            
            var folderID = query.FolderId.Split('_');
            query.FolderId = folderID[1];

            if (folderID[0] == "video")
            {
                return await GetVideos(query, cancellationToken).ConfigureAwait(false);
            }
            if (folderID[0] == "tvChannels")
            {
                return await menu.GetTVChannels(cancellationToken).ConfigureAwait(false);
            }
            if (folderID[0] == "categories")
            {
                return await menu.GetCategories("", "", cancellationToken).ConfigureAwait(false);
            }
            if (folderID[0] == "category")
            {

                return await menu.GetCategory(query.FolderId, "", cancellationToken).ConfigureAwait(false);
            }
            if (folderID[0] == "a-z")
            {
                return await menu.GetAToZ(cancellationToken).ConfigureAwait(false);
            }
            

            return null;
        }