private async void SetUstreamElements() { var filterList = new Dictionary <string, string> { { "platform", "PS4" }, { "type", "live" }, { "interactive", "true" } }; UstreamEntity ustreamList = await _liveStreamManager.GetUstreamFeed(0, 80, "compact", filterList, "views", string.Empty, App.UserAccountEntity); if (ustreamList == null) { return; } if (ustreamList.items == null) { return; } foreach (UstreamEntity.Item ustream in ustreamList.items) { var entity = new LiveBroadcastEntity(); entity.ParseFromUstream(ustream); LiveBroadcastCollection.Add(entity); } }
private async Task SetUstreamElements(bool interactive = false, string query = "") { var filterList = new Dictionary <string, string> { { "platform", "PS4" }, { "type", "live" }, { "interactive", interactive ? "true" : "false" } }; var ustreamResultList = await _liveStreamManager.GetUstreamFeed(0, 80, "compact", filterList, "views", query, Locator.ViewModels.MainPageVm.CurrentTokens); await AccountAuthHelpers.UpdateTokens(Locator.ViewModels.MainPageVm.CurrentUser, ustreamResultList); var result = await ResultChecker.CheckSuccess(ustreamResultList); if (!result) { return; } var ustreamList = JsonConvert.DeserializeObject <UstreamEntity>(ustreamResultList.ResultJson); if (ustreamList?.items == null) { return; } foreach (UstreamEntity.Item ustream in ustreamList.items) { var entity = new LiveBroadcastEntity(); entity.ParseFromUstream(ustream); LiveBroadcastCollection.Add(entity); } }
private async void LoadLiveFromPlaystationList() { LoadingProgressBar.Visibility = Visibility.Visible; var liveStreamManager = new LiveStreamManager(); // TODO: Remove hardcoded filter list values. Currently this is used for testing. var filterList = new Dictionary <string, string> { { "platform", "PS4" }, { "type", "live" }, { "interactive", "true" } }; var ustreamList = await liveStreamManager.GetUstreamFeed(0, 80, "compact", filterList, "views", string.Empty, App.UserAccountEntity); var twitchList = await liveStreamManager.GetTwitchFeed(0, 80, "PS4", "true", string.Empty, App.UserAccountEntity); LoadingProgressBar.Visibility = Visibility.Collapsed; return; }