Example #1
0
        public void AddTiredSong(PandoraSession session, PandoraSong song, WebProxy proxy)
        {
            if (session == null || session.User == null) throw new PandoraException("User must be logged in to make this request.");

            ExecuteRequest(new SleepSongRequest(session, song.Token), proxy);
            song.TemporarilyBanned = true;
        }
Example #2
0
        public List<PandoraStationCategory> GetGenreStations(PandoraSession session, WebProxy proxy)
        {
            if (session == null || session.User == null)
                throw new PandoraException("User must be logged in to make this request.");

            GetGenreStationsResponse response = (GetGenreStationsResponse)ExecuteRequest(new GetGenreStationsRequest(session), proxy);
            return response.Categories;
        }
 public AddFeedbackRequest(PandoraSession session, string stationToken, string trackToken, bool positive)
     : base(session)
 {
     this.StationToken = stationToken;
     this.TrackToken = trackToken;
 }
 public GetPlaylistRequest(PandoraSession session, string stationToken)
     : base(session)
 {
     this.StationToken = stationToken;
 }
 public GetStationListRequest(PandoraSession session)
     : base(session)
 {
 }
 public GetGenreStationsRequest(PandoraSession session)
     : base(session)
 {
 }
 public PandoraRequest(PandoraSession session)
 {
     this.Session = session;
     this.User = session == null ? null : session.User;
 }
Example #8
0
        /// <summary>
        /// Retrieves a playlist for the given station.
        /// </summary>
        public List<PandoraSong> GetSongs(PandoraSession session, PandoraStation station, WebProxy proxy)
        {
            if (session == null || session.User == null) throw new PandoraException("User must be logged in to make this request.");

            GetPlaylistResponse response = (GetPlaylistResponse)ExecuteRequest(new GetPlaylistRequest(session, station.Token), proxy);
            return response.Songs;
        }
Example #9
0
 public void AddTiredSong(PandoraSession session, PandoraSong song)
 {
     AddTiredSong(session, song, null);
 }
Example #10
0
 /// <summary>
 /// Given the username and password, attempts to log into the Pandora music service.
 /// </summary>
 /// <returns>If login is successful, returns a PandoraUser object. If invalid username or password
 /// null is returned.</returns>
 public PandoraUser UserLogin(PandoraSession session, string username, string password)
 {
     return UserLogin(session, username, password, null);
 }
Example #11
0
        /// <summary>
        /// Given the username and password, attempts to log into the Pandora music service.
        /// </summary>
        /// <returns>If login is successful, returns a PandoraUser object. If invalid username or password
        /// null is returned.</returns>
        public PandoraUser UserLogin(PandoraSession session, string username, string password, WebProxy proxy)
        {
            try {
                PandoraUser user = (PandoraUser) ExecuteRequest(new UserLoginRequest(session, username, password), proxy);
                session.User = user;
                user.Password = password;
                return user;
            }
            catch (PandoraException e) {
                if (e.ErrorCode == ErrorCodeEnum.AUTH_INVALID_USERNAME_PASSWORD)
                    return null;

                throw;
            }
        }
Example #12
0
        public PandoraSongFeedback RateSong(PandoraSession session, PandoraStation station, PandoraSong song, PandoraRating rating, WebProxy proxy)
        {
            if (session == null || session.User == null) throw new PandoraException("User must be logged in to make this request.");

            PandoraSongFeedback feedbackObj = (PandoraSongFeedback)ExecuteRequest(new AddFeedbackRequest(session, station.Token, song.Token, rating == PandoraRating.Love), proxy);
            song.Rating = rating;

            return feedbackObj;
        }
Example #13
0
 public PandoraSongFeedback RateSong(PandoraSession session, PandoraStation station, PandoraSong song, PandoraRating rating)
 {
     return RateSong(session, station, song, rating, null);
 }
Example #14
0
 /// <summary>
 /// Retrieves a list of stations for the current user.
 /// </summary>
 public List<PandoraStation> GetStations(PandoraSession session)
 {
     return GetStations(session, null);
 }
 public SleepSongRequest(PandoraSession session, string trackToken)
     : base(session)
 {
     this.TrackToken = trackToken;
 }
Example #16
0
 /// <summary>
 /// Retrieves all available genre stations.
 /// </summary>
 /// <param name="session"></param>
 /// <returns></returns>
 public List<PandoraStationCategory> GetGenreStations(PandoraSession session)
 {
     return GetGenreStations(session, null);
 }
 public UserLoginRequest(PandoraSession session, string username, string password)
     : base(session)
 {
     this.UserName = username;
     this.Password = password;
 }
Example #18
0
 /// <summary>
 /// Retrieves a playlist for the given station.
 /// </summary>
 public List<PandoraSong> GetSongs(PandoraSession session, PandoraStation station)
 {
     return GetSongs(session, station, null);
 }