stop looking for data

This commit is contained in:
Roy Olav Purser 2021-05-28 16:10:13 +02:00
parent c021da3441
commit 6ed8b6264e
Signed by: roypur
GPG Key ID: E14D26A036F21656

View File

@ -56,6 +56,8 @@ class StreamData():
return self.values.get("title")
def description(self):
return self.values.get("description")
def complete(self):
return None not in self.values.values()
def meta(self):
data = []
if isinstance(self.values.get("thumbnail"), str):
@ -204,6 +206,8 @@ async def get_any(upstream, proxy, logger):
result.update("thumbnail", temp_result.thumbnail(), temp_result.override)
result.update("title", temp_result.title(), temp_result.override)
result.update("description", temp_result.description(), temp_result.override)
if result.complete():
break
for task in tasks:
if not task.done():
task.cancel()