Esempio n. 1
0
        /// <summary>
        /// Creates a new playlist for the authenticated user.
        /// </summary>
        /// <param name="title">
        /// A <see cref="System.String"/>
        /// </param>
        /// <param name="description">
        /// A <see cref="System.String"/>
        /// </param>
        /// <param name="session">
        /// A <see cref="Session"/>
        /// </param>
        /// <returns>
        /// A <see cref="Playlist"/>
        /// </returns>
        public static Playlist CreateNew(string title, string description, Session session)
        {
            //manually test session for authentication.
            if (!session.Authenticated)
            {
                throw new AuthenticationRequiredException();
            }


            RequestParameters p = new Lastfm.RequestParameters();

            p["title"]       = title;
            p["description"] = description;

            XmlDocument doc = (new Request("playlist.create", session, p)).execute();
            int         id  = Int32.Parse(doc.GetElementsByTagName("id")[0].InnerText);

            return(new Playlist(AuthenticatedUser.GetUser(session), id, session));
        }
 public RecommendedArtists(AuthenticatedUser user, Session session) : base("user.getRecommendedArtists", session)
 {
     User = user;
 }
Esempio n. 3
0
 public RecommendedEvents(AuthenticatedUser user, Session session)
     : base("user.getRecommendedEvents", session)
 {
     this.User = user;
 }