Skip to content

Commit

Permalink
Some changes to the user class. getFriendsThatListenTo and set the ag…
Browse files Browse the repository at this point in the history
…e of the user.
  • Loading branch information
eartle committed Jul 20, 2012
1 parent 5b65943 commit fc018a3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/User.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/
#include "User.h"
#include "Track.h"
#include "Artist.h"
#include "UrlBuilder.h"
#include "XmlQuery.h"

Expand Down Expand Up @@ -401,6 +402,17 @@ User::getFriendsListeningNow( int limit, int page ) const
}


QNetworkReply*
User::getFriendsThatListenTo( const lastfm::Artist& artist, int limit, int page ) const
{
QMap<QString, QString> map = params( "getFriendsThatListenTo" );
map["artist"] = artist.name();
map["limit"] = QString::number( limit );
map["page"] = QString::number( page );
return ws::get( map );
}


QNetworkReply*
User::getLovedTracks( int limit, int page ) const
{
Expand Down Expand Up @@ -620,6 +632,11 @@ User::setImages( const QList<QUrl>& images )
d->m_images = images;
}

unsigned short
User::age() const
{
return d->m_age;
}

void
User::setAge( unsigned short age )
Expand Down
3 changes: 3 additions & 0 deletions src/User.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ namespace lastfm
{
class UserList;
class XmlQuery;
class Artist;

class LASTFM_DLLEXPORT Gender
{
Expand Down Expand Up @@ -103,6 +104,7 @@ namespace lastfm
QUrl imageUrl( ImageSize size = LargeImage, bool square = false ) const;
void setImages( const QList<QUrl>& images );

unsigned short age() const;
void setAge( unsigned short age );

void setGender( const QString& s );
Expand All @@ -114,6 +116,7 @@ namespace lastfm
/** use User::list() on the response to get a UserList */
QNetworkReply* getFriends( bool recentTracks = false, int limit = 50, int page = 1 ) const;
QNetworkReply* getFriendsListeningNow( int limit = 50, int page = 1 ) const;
QNetworkReply* getFriendsThatListenTo( const lastfm::Artist& artist, int limit = 50, int page = 1 ) const;
QNetworkReply* getNeighbours( int limit = 50, int page = 1 ) const;

QNetworkReply* getLovedTracks( int limit = 50, int page = 1 ) const;
Expand Down

0 comments on commit fc018a3

Please sign in to comment.