fix: 修复 bangumi search API 中的流式接口,webui 对应接口定义方法改造

- StreamingResponse 换成 EventSourceResponse,即 Server Send Event Source 方式发送数据
- webui 中 search 接口改成 rxjs Observable 方式,
  这次来不及改到 vue 里,但是写了接口 usage example;
- 顺手补了一些 vscode 通用的开发配置,
  补了之前配置文件解析漏了一个可用环境变量的 host 字段
This commit is contained in:
zthxxx
2023-08-31 23:48:07 +08:00
parent 16bbf6f866
commit 7d50e360ed
12 changed files with 177 additions and 23 deletions

View File

@@ -10,7 +10,7 @@ class Program(BaseModel):
class Downloader(BaseModel):
type: str = Field("qbittorrent", description="Downloader type")
host: str = Field("172.17.0.1:8080", description="Downloader host")
host_: str = Field("172.17.0.1:8080", alias="host", description="Downloader host")
username_: str = Field("admin", alias="username", description="Downloader username")
password_: str = Field(
"adminadmin", alias="password", description="Downloader password"
@@ -18,6 +18,10 @@ class Downloader(BaseModel):
path: str = Field("/downloads/Bangumi", description="Downloader path")
ssl: bool = Field(False, description="Downloader ssl")
@property
def host(self):
return expandvars(self.host_)
@property
def username(self):
return expandvars(self.username_)