Beispiel #1
0
	def results(self, query):
		if "artist" not in query or "track" not in query:
			return []
		data = napster.getStreamData(query["artist"], query.get("album", ""), query["track"])
		if data is None:
			return []

		res = []
		for track in data:
			res.append(self.make_track_result(track, query))
		return res	
	def results(self, query):
		data = napster.getStreamData(query['artist'], query['album'], query['track'])
		if data is None:
			return []

		res = []
		for track in data:
			res.append({
				'artist': track["artist"],
				'track' : track["track"],
				'album' : track["album"],
				'source' : "Napster",
				'url' : track["url"],
				'duration' : track["duration"],
				'score' : 1.00
					})
		return res	
Beispiel #3
0
    def results(self, query):
        data = napster.getStreamData(query['artist'], query['album'],
                                     query['track'])
        if data is None:
            return []

        res = []
        for track in data:
            res.append({
                'artist': track["artist"],
                'track': track["track"],
                'album': track["album"],
                'source': "Napster",
                'url': track["url"],
                'duration': track["duration"],
                'score': 1.00
            })
        return res