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))); }
/// <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)); }
public FavoriteUser(UserWithChannelModel user, GameTypeSimpleModel game, bool canBeRemoved = false) { this.User = user; this.game = game; this.CanBeRemoved = canBeRemoved; }
/// <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); }