mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-07 20:30:08 +03:00
fix python scripts read offset (#13574)
Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
@@ -34,9 +34,10 @@ def view(
|
||||
|
||||
devices = []
|
||||
|
||||
current = 1
|
||||
current = 0
|
||||
|
||||
while True:
|
||||
current += 1
|
||||
params["current"] = current
|
||||
response = requests.get(f"{url}/api/devices", headers=headers, params=params)
|
||||
if response.status_code != 200:
|
||||
@@ -61,8 +62,7 @@ def view(
|
||||
devices.append(device)
|
||||
|
||||
total = response_json.get("total", 0)
|
||||
current += pageSize
|
||||
if len(data) < pageSize or current > total:
|
||||
if len(data) < pageSize or current * pageSize >= total:
|
||||
break
|
||||
|
||||
return devices
|
||||
|
||||
Reference in New Issue
Block a user