From a97c5840590a419590cac8218e29c02647b35cb6 Mon Sep 17 00:00:00 2001 From: hugovk Date: Tue, 4 Mar 2014 18:17:37 +0200 Subject: [PATCH] Implement geo.getMetroUniqueArtistChart for #44 --- pylast.py | 12 +++++++++--- test_pylast.py | 5 +++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/pylast.py b/pylast.py index 542e0ab..134b49d 100644 --- a/pylast.py +++ b/pylast.py @@ -2194,14 +2194,20 @@ class Metro(_BaseObject): """ return self._get_chart("geo.getMetroHypeArtistChart", limit, from_date, to_date, cacheable) + def get_unique_artist_chart(self, limit=None, from_date=None, to_date=None, cacheable=True): + """Get a chart of the artists which make that metro unique. + Parameters: + from_date (Optional) : Beginning timestamp of the weekly range requested + to_date (Optional) : Ending timestamp of the weekly range requested + limit (Optional) : The number of results to fetch per page. Defaults to 50. + """ + return self._get_chart("geo.getMetroUniqueArtistChart", limit, from_date, to_date, cacheable) + # TODO? - # geo.getMetroHypeArtistChart # geo.getMetroHypeTrackChart # geo.getMetroTrackChart - # geo.getMetroUniqueArtistChart # geo.getMetroUniqueTrackChart - # geo.getMetroWeeklyChartlist class Library(_BaseObject): diff --git a/test_pylast.py b/test_pylast.py index c453488..67b6d49 100755 --- a/test_pylast.py +++ b/test_pylast.py @@ -944,6 +944,11 @@ class TestPyLast(unittest.TestCase): self.helper_get_metro_and_dates("get_hype_artist_chart") + def test_get_metro_unique_artist_chart(self): + # Arrange/Act/Assert + self.helper_get_metro_and_dates("get_unique_artist_chart") + + def test_geo_get_metros(self): # Arrange # Act