mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-06-09 17:50:23 +08:00
feat:通过消息订阅时转换为MP用户名
This commit is contained in:
@@ -96,3 +96,16 @@ class UserOper(DbOper):
|
||||
if settings:
|
||||
return settings.get(key)
|
||||
return None
|
||||
|
||||
def get_name(self, **kwargs) -> Optional[str]:
|
||||
"""
|
||||
根据绑定账号获取用户名称
|
||||
"""
|
||||
users = self.list()
|
||||
for user in users:
|
||||
user_setting = user.settings
|
||||
if user_setting:
|
||||
for k, v in kwargs.items():
|
||||
if user_setting.get(k) == v:
|
||||
return user.name
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user