def retrieve_results_for_topic(self, topic, offset, past_album): for a in data.get_user_top_albums(self.name,"overall"): self.all_albums.add((a["artist"],a["name"])) results = [] past = False for album in data.get_top_of_topic(topic, limit=100, offset=offset-1): if not past: if album["name"]==past_album: past=True continue if (album["artist"],album["name"]) in self.all_albums: continue results.append(album) return results
def retrieve_results(self): """retrieve results from db and return get_results()""" for a in data.get_user_top_albums(self.name,"overall"): self.all_albums.add((a["artist"],a["name"])) self.recent_albums = data.get_user_top_albums(self.name,"12month") return self._get_results()