Continued work on the UI
This commit is contained in:
parent
3f55cd1a15
commit
1db90b31e6
|
@ -202,6 +202,15 @@ class Deezer:
|
|||
tracks_array.append(track)
|
||||
return tracks_array
|
||||
|
||||
def search_gw(self, term):
|
||||
results = self.gw_api_call('deezer.pageSearch', {"query": term, "start": 0, "nb": 40, "suggest": True, "artist_suggest": True, "top_tracks": True})['results']
|
||||
order = []
|
||||
for x in results['ORDER']:
|
||||
if x in ['TOP_RESULT', 'TRACK', 'ALBUM', 'ARTIST', 'PLAYLIST']:
|
||||
order.append(x)
|
||||
results['ORDER'] = order
|
||||
return results
|
||||
|
||||
def get_lyrics_gw(self, sng_id):
|
||||
return self.gw_api_call('song.getLyrics', {'sng_id': sng_id})["results"]
|
||||
|
||||
|
|
|
@ -37,13 +37,16 @@ def initialize():
|
|||
login()
|
||||
return True
|
||||
|
||||
def search(term):
|
||||
def search(term, type):
|
||||
result = dz.search(term, type)
|
||||
print(result)
|
||||
return result
|
||||
|
||||
def mainSearch(term):
|
||||
if isValidLink(term):
|
||||
downloadLink(term)
|
||||
return {"message": "Downloaded!"}
|
||||
result = dz.search(term, "track")
|
||||
print(result)
|
||||
return result
|
||||
return dz.search_gw(term)
|
||||
|
||||
def downloadLink(url, bitrate=None):
|
||||
global settings
|
||||
|
|
Loading…
Reference in New Issue