public async Task GetRecentStations() { if (!_stationPageProgress.CanGoToNextPage()) { return; } InProgress = true; var userApi = new Core.Api.UserApi(Auth); var response = await userApi.GetRecentStations(Auth.UserSession.Username, _stationPageProgress.ExpectedPage, 5); _stationPageProgress.PageLoaded(response.Success); if (response.Success) { foreach (var s in response.Content) { Stations.Add(s); } } _stationPageProgress.TotalPages = response.TotalPages; InProgress = false; }
public async Task GetHistory() { if (!_historyPageProgress.CanGoToNextPage()) { return; } InProgress = true; var userApi = new Core.Api.UserApi(Auth); var response = await userApi.GetRecentScrobbles(Auth.UserSession.Username, DateTime.UtcNow.AddMonths(-1), _historyPageProgress.ExpectedPage, 50); Successful = response.Success; _historyPageProgress.PageLoaded(Successful); if (response.Success) { foreach (var track in response.Content) { Tracks.Add(track); } } _historyPageProgress.TotalPages = response.TotalPages; InProgress = false; }