in the line of code below, I'm trying to process track_ids
, a set
which does not allow indexing
.
track_name = sp.track(track_ids[i])['name']
how do I convert track_ids
into a list
so I'm able to index it?
EDIT: this is the complete function:
def filterBelowThreshold(product, filter_name, track_ids, values,
xsongs, threshold):
print product.upper(), 'PLAYLIST:'
for i, x in enumerate(values):
if x < threshold:
track_name = sp.track(track_ids[i])['name']
#append minding foreign track names
xsongs.add(track_name.encode("utf-8"))
print product.upper(),'-', "{} = {}".format(track_name.encode("utf-8"), x), filter_name