summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-03-19 00:32:01 -0500
committerJesse Luehrs <doy@tozt.net>2012-03-19 00:32:01 -0500
commitcc3bb1de114ac1d52f2ebb8986e4f996903ca8d8 (patch)
tree488a30f4be872bcbca44c6dd9e3e85049619caeb
parentf87eeba7fd87a83f75e445d9ef2ec55f46b24668 (diff)
downloadlastfm-export-cc3bb1de114ac1d52f2ebb8986e4f996903ca8d8.tar.gz
lastfm-export-cc3bb1de114ac1d52f2ebb8986e4f996903ca8d8.zip
allow passing parameters to the track_count method too
-rw-r--r--lib/LastFM/Export.pm11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/LastFM/Export.pm b/lib/LastFM/Export.pm
index c36f65f..dfad065 100644
--- a/lib/LastFM/Export.pm
+++ b/lib/LastFM/Export.pm
@@ -34,12 +34,13 @@ has lastfm => (
sub track_count {
my $self = shift;
+ my (%params) = @_;
+
+ $params{method} = 'user.getRecentTracks';
+ $params{user} = $self->user;
+ $params{limit} = 1;
- return $self->lastfm->request(
- method => 'user.getRecentTracks',
- user => $self->user,
- limit => 1,
- )->{recenttracks}{'@attr'}{total};
+ return $self->lastfm->request(%params)->{recenttracks}{'@attr'}{total};
}
sub tracks {