From 4b2d9a15f9e5c09424815037cd3ef7e12b06c113 Mon Sep 17 00:00:00 2001 From: RemixDev Date: Thu, 9 Apr 2020 16:06:33 +0200 Subject: [PATCH] Added search continuous scrolling --- deemix/api/deezer.py | 5 ++++- deemix/app/main.py | 10 ++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/deemix/api/deezer.py b/deemix/api/deezer.py index 3c80c8a..a1ce412 100755 --- a/deemix/api/deezer.py +++ b/deemix/api/deezer.py @@ -202,7 +202,7 @@ class Deezer: tracks_array.append(track) return tracks_array - def search_gw(self, term): + def search_main_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']: @@ -211,6 +211,9 @@ class Deezer: results['ORDER'] = order return results + def search_gw(self, term, type, start, nb=20): + return self.gw_api_call('search.music', {"query": term, "filter":"ALL", "output":type, "start": start, "nb": nb})['results'] + def get_lyrics_gw(self, sng_id): return self.gw_api_call('song.getLyrics', {'sng_id': sng_id})["results"] diff --git a/deemix/app/main.py b/deemix/app/main.py index 82e3f0d..0b942f0 100644 --- a/deemix/app/main.py +++ b/deemix/app/main.py @@ -37,13 +37,11 @@ def initialize(): login() return True -def search(term, type): - result = dz.search(term, type) - print(result) - return result - def mainSearch(term): - return dz.search_gw(term) + return dz.search_main_gw(term) + +def search(term, type, start, nb): + return dz.search_gw(term, type, start, nb) def downloadLink(url, bitrate=None): global settings