diff --git a/src/IF.Lastfm.Core/Api/ArtistApi.cs b/src/IF.Lastfm.Core/Api/ArtistApi.cs index e0683e7..1aab1c7 100644 --- a/src/IF.Lastfm.Core/Api/ArtistApi.cs +++ b/src/IF.Lastfm.Core/Api/ArtistApi.cs @@ -104,8 +104,9 @@ public Task> GetTagsByUserAsync(string artist, string user public Task> GetTopTagsAsync(string artist, bool autocorrect = false) { - var command = new GetTopTagsCommand(Auth, artist) + var command = new GetTopTagsCommand(Auth) { + ArtistName = artist, Autocorrect = autocorrect, HttpClient = HttpClient }; @@ -113,6 +114,19 @@ public Task> GetTopTagsAsync(string artist, bool autocorre return command.ExecuteAsync(); } + public Task> GetTopTagsByMbidAsync(string mbid, bool autocorrect = false) + { + var command = new GetTopTagsCommand(Auth) + { + ArtistMbid = mbid, + Autocorrect = autocorrect, + HttpClient = HttpClient + }; + + return command.ExecuteAsync(); + } + + public async Task> GetShoutsAsync(string artist, int page = 0, int count = LastFm.DefaultPageLength, bool autocorrect = false) { var command = new GetShoutsCommand(Auth, artist) diff --git a/src/IF.Lastfm.Core/Api/Commands/Artist/GetTopTagsCommand.cs b/src/IF.Lastfm.Core/Api/Commands/Artist/GetTopTagsCommand.cs index 2f02f53..05d148c 100644 --- a/src/IF.Lastfm.Core/Api/Commands/Artist/GetTopTagsCommand.cs +++ b/src/IF.Lastfm.Core/Api/Commands/Artist/GetTopTagsCommand.cs @@ -12,18 +12,27 @@ namespace IF.Lastfm.Core.Api.Commands.Artist [ApiMethodName("artist.getTopTags")] internal class GetTopTagsCommand : GetAsyncCommandBase> { + public string ArtistMbid { get; set; } + public string ArtistName { get; set; } public bool Autocorrect { get; set; } - public GetTopTagsCommand(ILastAuth auth, string artistName) : base(auth) + public GetTopTagsCommand(ILastAuth auth) : base(auth) { - ArtistName = artistName; + } public override void SetParameters() { - Parameters.Add("artist", ArtistName); + if (ArtistMbid != null) + { + Parameters.Add("mbid", ArtistMbid); + } + else + { + Parameters.Add("artist", ArtistName); + } Parameters.Add("autocorrect", Convert.ToInt32(Autocorrect).ToString()); }