fix: hardcode market_url fallback to turbosu.yeij.top
This commit is contained in:
+10
-10
@@ -494,7 +494,7 @@ async def api_delete_recording(filename: str):
|
|||||||
async def api_market_list():
|
async def api_market_list():
|
||||||
import httpx
|
import httpx
|
||||||
cfg = get_config()
|
cfg = get_config()
|
||||||
url = cfg.get("market_url", "http://127.0.0.1:5301")
|
url = cfg.get("market_url", "https://turbosu.yeij.top")
|
||||||
try:
|
try:
|
||||||
async with httpx.AsyncClient(timeout=10) as client:
|
async with httpx.AsyncClient(timeout=10) as client:
|
||||||
resp = await client.get(f"{url}/api/collections/dashboards/records?sort=-name&perPage=50")
|
resp = await client.get(f"{url}/api/collections/dashboards/records?sort=-name&perPage=50")
|
||||||
@@ -507,7 +507,7 @@ async def api_market_list():
|
|||||||
async def api_market_auth(data: dict):
|
async def api_market_auth(data: dict):
|
||||||
import httpx
|
import httpx
|
||||||
cfg = get_config()
|
cfg = get_config()
|
||||||
url = cfg.get("market_url", "http://127.0.0.1:5301")
|
url = cfg.get("market_url", "https://turbosu.yeij.top")
|
||||||
try:
|
try:
|
||||||
async with httpx.AsyncClient(timeout=10) as client:
|
async with httpx.AsyncClient(timeout=10) as client:
|
||||||
resp = await client.post(
|
resp = await client.post(
|
||||||
@@ -524,7 +524,7 @@ async def api_market_auth(data: dict):
|
|||||||
async def api_market_register(data: dict):
|
async def api_market_register(data: dict):
|
||||||
import httpx
|
import httpx
|
||||||
cfg = get_config()
|
cfg = get_config()
|
||||||
url = cfg.get("market_url", "http://127.0.0.1:5301")
|
url = cfg.get("market_url", "https://turbosu.yeij.top")
|
||||||
try:
|
try:
|
||||||
async with httpx.AsyncClient(timeout=10) as client:
|
async with httpx.AsyncClient(timeout=10) as client:
|
||||||
resp = await client.post(
|
resp = await client.post(
|
||||||
@@ -577,7 +577,7 @@ async def api_market_upload(file: UploadFile = File(...), name: str = "", catego
|
|||||||
return {"error": f"文件解析失败: {str(e)}"}
|
return {"error": f"文件解析失败: {str(e)}"}
|
||||||
|
|
||||||
cfg = get_config()
|
cfg = get_config()
|
||||||
url = cfg.get("market_url", "http://127.0.0.1:5301")
|
url = cfg.get("market_url", "https://turbosu.yeij.top")
|
||||||
try:
|
try:
|
||||||
async with httpx.AsyncClient(timeout=30) as client:
|
async with httpx.AsyncClient(timeout=30) as client:
|
||||||
resp = await client.post(
|
resp = await client.post(
|
||||||
@@ -600,7 +600,7 @@ async def api_market_upload(file: UploadFile = File(...), name: str = "", catego
|
|||||||
async def api_market_install(id: str = "", filename: str = ""):
|
async def api_market_install(id: str = "", filename: str = ""):
|
||||||
import httpx
|
import httpx
|
||||||
cfg = get_config()
|
cfg = get_config()
|
||||||
url = cfg.get("market_url", "http://127.0.0.1:5301")
|
url = cfg.get("market_url", "https://turbosu.yeij.top")
|
||||||
try:
|
try:
|
||||||
async with httpx.AsyncClient(timeout=60, follow_redirects=True) as client:
|
async with httpx.AsyncClient(timeout=60, follow_redirects=True) as client:
|
||||||
resp = await client.get(f"{url}/api/files/dashboards/{id}/{filename}")
|
resp = await client.get(f"{url}/api/files/dashboards/{id}/{filename}")
|
||||||
@@ -632,7 +632,7 @@ async def api_market_install(id: str = "", filename: str = ""):
|
|||||||
async def api_market_scenes():
|
async def api_market_scenes():
|
||||||
import httpx
|
import httpx
|
||||||
cfg = get_config()
|
cfg = get_config()
|
||||||
url = cfg.get("market_url", "http://127.0.0.1:5301")
|
url = cfg.get("market_url", "https://turbosu.yeij.top")
|
||||||
try:
|
try:
|
||||||
async with httpx.AsyncClient(timeout=10) as client:
|
async with httpx.AsyncClient(timeout=10) as client:
|
||||||
resp = await client.get(f"{url}/api/collections/scenes/records?sort=-name&perPage=50")
|
resp = await client.get(f"{url}/api/collections/scenes/records?sort=-name&perPage=50")
|
||||||
@@ -666,7 +666,7 @@ async def api_market_upload_scene(file: UploadFile = File(...), token: str = "")
|
|||||||
|
|
||||||
import httpx as _httpx
|
import httpx as _httpx
|
||||||
cfg = get_config()
|
cfg = get_config()
|
||||||
url = cfg.get("market_url", "http://127.0.0.1:5301")
|
url = cfg.get("market_url", "https://turbosu.yeij.top")
|
||||||
try:
|
try:
|
||||||
async with _httpx.AsyncClient(timeout=30) as client:
|
async with _httpx.AsyncClient(timeout=30) as client:
|
||||||
resp = await client.post(
|
resp = await client.post(
|
||||||
@@ -686,7 +686,7 @@ async def api_market_upload_scene(file: UploadFile = File(...), token: str = "")
|
|||||||
async def api_market_install_scene(id: str = "", filename: str = ""):
|
async def api_market_install_scene(id: str = "", filename: str = ""):
|
||||||
import httpx, io, zipfile, json as _json
|
import httpx, io, zipfile, json as _json
|
||||||
cfg = get_config()
|
cfg = get_config()
|
||||||
url = cfg.get("market_url", "http://127.0.0.1:5301")
|
url = cfg.get("market_url", "https://turbosu.yeij.top")
|
||||||
try:
|
try:
|
||||||
async with httpx.AsyncClient(timeout=60, follow_redirects=True) as client:
|
async with httpx.AsyncClient(timeout=60, follow_redirects=True) as client:
|
||||||
resp = await client.get(f"{url}/api/files/scenes/{id}/{filename}")
|
resp = await client.get(f"{url}/api/files/scenes/{id}/{filename}")
|
||||||
@@ -712,7 +712,7 @@ async def api_market_install_scene(id: str = "", filename: str = ""):
|
|||||||
async def api_market_mine(token: str = ""):
|
async def api_market_mine(token: str = ""):
|
||||||
import httpx
|
import httpx
|
||||||
cfg = get_config()
|
cfg = get_config()
|
||||||
url = cfg.get("market_url", "http://127.0.0.1:5301")
|
url = cfg.get("market_url", "https://turbosu.yeij.top")
|
||||||
result = {"dashboards": [], "scenes": []}
|
result = {"dashboards": [], "scenes": []}
|
||||||
try:
|
try:
|
||||||
async with httpx.AsyncClient(timeout=10) as client:
|
async with httpx.AsyncClient(timeout=10) as client:
|
||||||
@@ -731,7 +731,7 @@ async def api_market_mine(token: str = ""):
|
|||||||
async def api_market_delete(data: dict):
|
async def api_market_delete(data: dict):
|
||||||
import httpx
|
import httpx
|
||||||
cfg = get_config()
|
cfg = get_config()
|
||||||
url = cfg.get("market_url", "http://127.0.0.1:5301")
|
url = cfg.get("market_url", "https://turbosu.yeij.top")
|
||||||
try:
|
try:
|
||||||
async with httpx.AsyncClient(timeout=10) as client:
|
async with httpx.AsyncClient(timeout=10) as client:
|
||||||
collection = data.get("collection", "dashboards")
|
collection = data.get("collection", "dashboards")
|
||||||
|
|||||||
Reference in New Issue
Block a user