Remove dead Last.fm tag search
This commit is contained in:
parent
58b93c847e
commit
f70254b947
|
@ -445,12 +445,6 @@ class _Network(object):
|
||||||
|
|
||||||
return ArtistSearch(artist_name, self)
|
return ArtistSearch(artist_name, self)
|
||||||
|
|
||||||
def search_for_tag(self, tag_name):
|
|
||||||
"""Searches of a tag by its name. Returns a TagSearch object.
|
|
||||||
Use get_next_page() to retrieve sequences of results."""
|
|
||||||
|
|
||||||
return TagSearch(tag_name, self)
|
|
||||||
|
|
||||||
def search_for_track(self, artist_name, track_name):
|
def search_for_track(self, artist_name, track_name):
|
||||||
"""Searches of a track by its name and its artist. Set artist to an
|
"""Searches of a track by its name and its artist. Set artist to an
|
||||||
empty string if not available.
|
empty string if not available.
|
||||||
|
@ -2729,27 +2723,6 @@ class ArtistSearch(_Search):
|
||||||
return seq
|
return seq
|
||||||
|
|
||||||
|
|
||||||
class TagSearch(_Search):
|
|
||||||
"""Search for a tag by tag name."""
|
|
||||||
|
|
||||||
def __init__(self, tag_name, network):
|
|
||||||
|
|
||||||
_Search.__init__(self, "tag", {"tag": tag_name}, network)
|
|
||||||
|
|
||||||
def get_next_page(self):
|
|
||||||
"""Returns the next page of results as a sequence of Tag objects."""
|
|
||||||
|
|
||||||
master_node = self._retrieve_next_page()
|
|
||||||
|
|
||||||
seq = []
|
|
||||||
for node in master_node.getElementsByTagName("tag"):
|
|
||||||
tag = Tag(_extract(node, "name"), self.network)
|
|
||||||
tag.tag_count = _number(_extract(node, "count"))
|
|
||||||
seq.append(tag)
|
|
||||||
|
|
||||||
return seq
|
|
||||||
|
|
||||||
|
|
||||||
class TrackSearch(_Search):
|
class TrackSearch(_Search):
|
||||||
"""
|
"""
|
||||||
Search for a track by track title. If you don't want to narrow the results
|
Search for a track by track title. If you don't want to narrow the results
|
||||||
|
|
|
@ -340,18 +340,6 @@ class TestPyLastNetwork(PyLastTestCase):
|
||||||
self.assertIsInstance(results, list)
|
self.assertIsInstance(results, list)
|
||||||
self.assertIsInstance(results[0], pylast.Artist)
|
self.assertIsInstance(results[0], pylast.Artist)
|
||||||
|
|
||||||
def test_tag_search(self):
|
|
||||||
# Arrange
|
|
||||||
tag = "rock"
|
|
||||||
|
|
||||||
# Act
|
|
||||||
search = self.network.search_for_tag(tag)
|
|
||||||
results = search.get_next_page()
|
|
||||||
|
|
||||||
# Assert
|
|
||||||
self.assertIsInstance(results, list)
|
|
||||||
self.assertIsInstance(results[0], pylast.Tag)
|
|
||||||
|
|
||||||
def test_track_search(self):
|
def test_track_search(self):
|
||||||
# Arrange
|
# Arrange
|
||||||
artist = "Nirvana"
|
artist = "Nirvana"
|
||||||
|
|
Loading…
Reference in a new issue