Esempio n. 1
0
        private async Task RefreshView()
        {
            this.groupUsers.Clear();
            await this.RunAsyncOperation(async() =>
            {
                await this.favoriteGroup.RefreshGroup();

                foreach (UserWithChannelModel user in this.favoriteGroup.LastCheckUsers.OrderByDescending(u => u.channel.online).ThenByDescending(u => u.channel.viewersCurrent))
                {
                    GameTypeSimpleModel game = null;
                    if (user.channel.typeId != null)
                    {
                        game = await ChannelSession.Connection.GetGameType(user.channel.typeId.GetValueOrDefault());
                    }
                    this.groupUsers.Add(new FavoriteUser(user, game, !this.favoriteGroup.IsTeam));
                }
            });
        }
 public async Task <IEnumerable <ChannelModel> > GetChannelsByGameTypes(GameTypeSimpleModel gameType, uint maxResults = 1)
 {
     return(await this.RunAsync(this.Connection.GameTypes.GetChannelsByGameType(gameType, maxResults)));
 }
Esempio n. 3
0
        /// <summary>
        /// Gets all channels playing the specified game type. The search can be limited to a maximum number of results to speed
        /// up the operation as it can take a long time on large channels. This maximum number is a lower threshold and slightly
        /// more than the maximum number may be returned.
        /// </summary>
        /// <param name="gameType">The game type to search for</param>
        /// <param name="maxResults">The maximum number of results. Will be either that amount or slightly more</param>
        /// <returns>All channels with the specified game type</returns>
        public async Task <IEnumerable <ChannelModel> > GetChannelsByGameType(GameTypeSimpleModel gameType, uint maxResults = 1)
        {
            Validator.ValidateVariable(gameType, "gameType");

            return(await this.GetPagedAsync <ChannelModel>("types/" + gameType.id + "/channels", maxResults));
        }
Esempio n. 4
0
 public FavoriteUser(UserWithChannelModel user, GameTypeSimpleModel game, bool canBeRemoved = false)
 {
     this.User         = user;
     this.game         = game;
     this.CanBeRemoved = canBeRemoved;
 }
Esempio n. 5
0
        /// <summary>
        /// Gets all channels playing the specified game type. The search can be limited to a maximum number of results to speed
        /// up the operation as it can take a long time on large channels. This maximum number is a lower threshold and slightly
        /// more than the maximum number may be returned.
        /// </summary>
        /// <param name="gameType">The game type to search for</param>
        /// <param name="processResults">The function to process results as they come in</param>
        /// <param name="maxResults">The maximum number of results. Will be either that amount or slightly more</param>
        /// <returns>All channels with the specified game type</returns>
        public async Task GetChannelsByGameType(GameTypeSimpleModel gameType, Func <IEnumerable <ChannelModel>, Task> processResults, uint maxResults = 1)
        {
            Validator.ValidateVariable(gameType, "gameType");

            await this.GetPagedNumberAsync <ChannelModel>("types/" + gameType.id + "/channels", processResults, maxResults);
        }