mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-07 00:16:57 +08:00
fix: 修复插件身份代码质量门禁 (#6456)
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
"""插件来源身份的数据访问原语。"""
|
"""插件来源身份的数据访问原语。"""
|
||||||
|
|
||||||
|
from typing import cast
|
||||||
|
|
||||||
from sqlalchemy import select, update
|
from sqlalchemy import select, update
|
||||||
from sqlalchemy.orm import Session
|
from sqlalchemy.orm import Session
|
||||||
|
|
||||||
@@ -13,11 +15,14 @@ class PluginIdentityOper(DbOper):
|
|||||||
def get_by_plugin_id(self, plugin_id: str) -> PluginIdentity | None:
|
def get_by_plugin_id(self, plugin_id: str) -> PluginIdentity | None:
|
||||||
"""按规范化物理插件 ID 查询唯一身份。"""
|
"""按规范化物理插件 ID 查询唯一身份。"""
|
||||||
return self._execute_sync_query(
|
return self._execute_sync_query(
|
||||||
lambda session: session.execute(
|
lambda session: cast(
|
||||||
select(PluginIdentity).where(
|
PluginIdentity | None,
|
||||||
PluginIdentity.normalized_plugin_id == plugin_id
|
session.execute(
|
||||||
)
|
select(PluginIdentity).where(
|
||||||
).scalar_one_or_none()
|
PluginIdentity.normalized_plugin_id == plugin_id
|
||||||
|
)
|
||||||
|
).scalar_one_or_none(),
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
def stage_create(self, identity: PluginIdentity) -> None:
|
def stage_create(self, identity: PluginIdentity) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user