fixed issue with search by title

This commit is contained in:
Manuel Cortez 2019-06-12 22:43:20 -05:00
parent dd23ce6adf
commit 6a16a66b5e

View File

@ -29,6 +29,7 @@ class interface(object):
raise ValueError("Text must be passed and should not be blank.")
log.debug("Retrieving data from Tidal...")
fieldtypes = ["artist", "album", "playlist"]
field = "track"
for i in fieldtypes:
if text.startswith(i+"://"):
field = i
@ -36,7 +37,7 @@ class interface(object):
log.debug("Searching for %s..." % (field))
search_response = self.session.search(value=text, field=field)
self.results = []
if field == "tracks":
if field == "track":
data = search_response.tracks
elif field == "artist":
data = []