/// <summary> /// 添加玩家集邮卡牌 /// </summary> /// <param name="userId">玩家 ID</param> /// <param name="albumType">1、佣兵 2、装备 3、魂技</param> /// <param name="albumID">对应的 ID</param> public static void AddUserAlbum(string userId, AlbumType albumType, int albumID) { var userAlbum = _cacheSetAlbum.FindKey(userId); if (userAlbum != null) { var album = userAlbum.AlbumList.Find(s => s.AlbumProperty == albumType && s.ID == albumID); if (album == null) { album = new Album(); album.AlbumProperty = albumType; album.ID = albumID; userAlbum.AlbumList.Add(album); } } }
public static String GetArtistAlbums(String artistId, AlbumType albumType) { return String.Format(GetArtistAlbumsEndpoint, artistId, albumType.GetParameterNameAttribute(","), SpotifyClientService.Country); }
/// <summary> /// Get Spotify catalog information about an artist’s albums. Optional parameters can be specified in the query string /// to filter and sort the response. /// </summary> /// <param name="id">The Spotify ID for the artist.</param> /// <param name="type"> /// A list of keywords that will be used to filter the response. If not supplied, all album types will /// be returned /// </param> /// <param name="limit">The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50.</param> /// <param name="offset">The index of the first album to return. Default: 0</param> /// <param name="market"> /// An ISO 3166-1 alpha-2 country code. Supply this parameter to limit the response to one particular /// geographical market /// </param> /// <returns></returns> public string GetArtistsAlbums(String id, AlbumType type = AlbumType.All, int limit = 20, int offset = 0, String market = "") { limit = Math.Min(limit, 50); StringBuilder builder = new StringBuilder(APIBase + "/artists/" + id + "/albums"); builder.Append("?album_type=" + type.GetStringAttribute(",")); builder.Append("&limit=" + limit); builder.Append("&offset=" + offset); if (!String.IsNullOrEmpty(market)) builder.Append("&market=" + market); return builder.ToString(); }