mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 07:27:15 +08:00
fix bug
This commit is contained in:
@@ -199,6 +199,14 @@ class Settings(BaseSettings):
|
|||||||
except (ValueError, TypeError):
|
except (ValueError, TypeError):
|
||||||
raise ValueError(f"{value} 格式错误,不是有效数字!")
|
raise ValueError(f"{value} 格式错误,不是有效数字!")
|
||||||
|
|
||||||
|
@validator("COOKIECLOUD_ENABLE_LOCAL",
|
||||||
|
"SUBSCRIBE_SEARCH",
|
||||||
|
pre=True, always=True)
|
||||||
|
def convert_boolean(cls, value):
|
||||||
|
if not value:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
@validator("API_TOKEN", pre=True, always=True)
|
@validator("API_TOKEN", pre=True, always=True)
|
||||||
def validate_api_token(cls, v):
|
def validate_api_token(cls, v):
|
||||||
if not v:
|
if not v:
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ class MediaServerOper(DbOper):
|
|||||||
"""
|
"""
|
||||||
新增媒体服务器数据
|
新增媒体服务器数据
|
||||||
"""
|
"""
|
||||||
|
# MediaServerItem中没有的属性剔除
|
||||||
|
kwargs = {k: v for k, v in kwargs.items() if hasattr(MediaServerItem, k)}
|
||||||
item = MediaServerItem(**kwargs)
|
item = MediaServerItem(**kwargs)
|
||||||
if not item.get_by_itemid(self._db, kwargs.get("item_id")):
|
if not item.get_by_itemid(self._db, kwargs.get("item_id")):
|
||||||
item.create(self._db)
|
item.create(self._db)
|
||||||
|
|||||||
Reference in New Issue
Block a user