mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-06-02 06:00:56 +08:00
fix siteuserdata
This commit is contained in:
@@ -13,6 +13,8 @@ class SiteUserData(Base):
|
||||
id = Column(Integer, Sequence('id'), primary_key=True, index=True)
|
||||
# 站点域名
|
||||
domain = Column(String, index=True)
|
||||
# 站点名称
|
||||
name = Column(String)
|
||||
# 用户名
|
||||
username = Column(String)
|
||||
# 用户ID
|
||||
|
||||
@@ -105,7 +105,7 @@ class SiteOper(DbOper):
|
||||
})
|
||||
return True, "更新站点RSS地址成功"
|
||||
|
||||
def update_userdata(self, domain: str, payload: dict) -> Tuple[bool, str]:
|
||||
def update_userdata(self, domain: str, name: str, payload: dict) -> Tuple[bool, str]:
|
||||
"""
|
||||
更新站点用户数据
|
||||
"""
|
||||
@@ -114,6 +114,7 @@ class SiteOper(DbOper):
|
||||
current_time = datetime.now().strftime('%H:%M:%S')
|
||||
payload.update({
|
||||
"domain": domain,
|
||||
"name": name,
|
||||
"updated_day": current_day,
|
||||
"updated_time": current_time
|
||||
})
|
||||
@@ -130,6 +131,12 @@ class SiteOper(DbOper):
|
||||
SiteUserData(**payload).create(self._db)
|
||||
return True, "更新站点用户数据成功"
|
||||
|
||||
def get_userdata(self) -> List[SiteUserData]:
|
||||
"""
|
||||
获取站点用户数据
|
||||
"""
|
||||
return SiteUserData.list(self._db)
|
||||
|
||||
def get_userdata_by_domain(self, domain: str, workdate: str = None) -> List[SiteUserData]:
|
||||
"""
|
||||
获取站点用户数据
|
||||
|
||||
Reference in New Issue
Block a user