mirror of
https://github.com/FAUSheppy/homelab_gamevault
synced 2025-12-06 15:01:36 +01:00
feat: implement wait without return content
This commit is contained in:
@@ -100,7 +100,7 @@ class HTTP(DataBackend):
|
|||||||
#print(self.server + HTTP.REMOTE_PATH)
|
#print(self.server + HTTP.REMOTE_PATH)
|
||||||
return self.server + HTTP.REMOTE_PATH
|
return self.server + HTTP.REMOTE_PATH
|
||||||
|
|
||||||
def get(self, path, cache_dir="", return_content=False):
|
def get(self, path, cache_dir="", return_content=False, wait=False):
|
||||||
|
|
||||||
print("Getting", path, "cache dir", cache_dir, "return content:", return_content)
|
print("Getting", path, "cache dir", cache_dir, "return content:", return_content)
|
||||||
|
|
||||||
@@ -133,7 +133,7 @@ class HTTP(DataBackend):
|
|||||||
|
|
||||||
if not os.path.isfile(local_file) or os.stat(local_file).st_size == 0:
|
if not os.path.isfile(local_file) or os.stat(local_file).st_size == 0:
|
||||||
|
|
||||||
if return_content:
|
if return_content or wait:
|
||||||
|
|
||||||
# the content is needed for the UI now and not cached, it's needs to be downloaded synchroniously #
|
# the content is needed for the UI now and not cached, it's needs to be downloaded synchroniously #
|
||||||
# as there cannot be a meaningful UI-draw without it. #
|
# as there cannot be a meaningful UI-draw without it. #
|
||||||
@@ -145,7 +145,11 @@ class HTTP(DataBackend):
|
|||||||
|
|
||||||
# return the content #
|
# return the content #
|
||||||
print("Content for", fullpath, ":", r.text)
|
print("Content for", fullpath, ":", r.text)
|
||||||
|
|
||||||
|
if return_content:
|
||||||
return r.text
|
return r.text
|
||||||
|
else:
|
||||||
|
return local_file
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print("Async Requested for:", local_file)
|
print("Async Requested for:", local_file)
|
||||||
|
|||||||
Reference in New Issue
Block a user