only add to cache if not empty
This commit is contained in:
parent
a38d7bef9c
commit
1176c35981
@ -78,6 +78,11 @@ class StreamData():
|
||||
return self.values.get("description")
|
||||
def complete(self):
|
||||
return None not in self.values.values()
|
||||
def has_data(self):
|
||||
for elem in self.values.values():
|
||||
if isinstance(elem, str):
|
||||
return True
|
||||
return False
|
||||
def meta(self):
|
||||
data = []
|
||||
if isinstance(self.values.get("thumbnail"), str):
|
||||
@ -246,8 +251,9 @@ async def get_from_runner(cache_key, runner, logger):
|
||||
except Exception as e:
|
||||
logger.info(e)
|
||||
else:
|
||||
upstream_cache[cache_key] = result_temp
|
||||
result = result_temp
|
||||
if isinstance(result_temp, StreamData) and result_temp.has_data():
|
||||
upstream_cache[cache_key] = result_temp
|
||||
result = result_temp
|
||||
return result
|
||||
|
||||
async def get_streamlink(upstream, proxy, logger):
|
||||
|
Loading…
Reference in New Issue
Block a user