Tidying user.getTopAlbums call.

This commit is contained in:
Rikki Tooley 2013-07-23 15:48:03 +01:00
parent 3565a10387
commit 05d93bbd34
2 changed files with 15 additions and 13 deletions

View File

@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using IF.Lastfm.Core.Api.Enums;
using IF.Lastfm.Core.Api.Helpers;
@ -11,14 +10,16 @@ public interface IUserApi
{
IAuth Auth { get; }
Task<PageResponse<Album>> GetTopAlbums(LastStatsTimeSpan span,
int startIndex = 0,
int endIndex = LastFm.DefaultPageLength);
Task<PageResponse<Album>> GetTopAlbums(string username,
LastStatsTimeSpan span,
int startIndex = 0,
int endIndex = LastFm.DefaultPageLength);
Task<PageResponse<Track>> GetRecentScrobbles(string username, DateTime since,
int startIndex = 0,
int endIndex = LastFm.DefaultPageLength);
int startIndex = 0,
int endIndex = LastFm.DefaultPageLength);
Task<PageResponse<Station>> GetRecentStations(int pagenumber, int count = LastFm.DefaultPageLength);
Task<PageResponse<Station>> GetRecentStations(int pagenumber,
int count = LastFm.DefaultPageLength);
}
}

View File

@ -22,15 +22,16 @@ public UserApi(IAuth auth)
}
/// <summary>
/// TODO paging
/// Gets the top albums for the given user.
/// </summary>
/// <param name="username"></param>
/// <param name="span"></param>
/// <param name="startIndex"></param>
/// <param name="amount"></param>
/// <param name="pagenumber"></param>
/// <param name="count"></param>
/// <returns></returns>
public async Task<PageResponse<Album>> GetTopAlbums(LastStatsTimeSpan span, int pagenumber = 0, int count = LastFm.DefaultPageLength)
public async Task<PageResponse<Album>> GetTopAlbums(string username, LastStatsTimeSpan span, int pagenumber = 0, int count = LastFm.DefaultPageLength)
{
var command = new GetTopAlbumsCommand(Auth, Auth.User.Username, span)
var command = new GetTopAlbumsCommand(Auth, username, span)
{
Page = pagenumber,
Count = count
@ -45,7 +46,7 @@ public async Task<PageResponse<Album>> GetTopAlbums(LastStatsTimeSpan span, int
/// <param name="username"></param>
/// <param name="since"></param>
/// <param name="pagenumber"></param>
/// <param name="endIndex"></param>
/// <param name="count"></param>
/// <returns></returns>
public async Task<PageResponse<Track>> GetRecentScrobbles(string username, DateTime since, int pagenumber = 0, int count = LastFm.DefaultPageLength)
{