mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-07-08 00:01:27 +08:00
add media exists api
This commit is contained in:
@@ -21,8 +21,8 @@ class Settings(BaseSettings):
|
||||
HOST: str = "0.0.0.0"
|
||||
# API监听端口
|
||||
PORT: int = 3001
|
||||
# 是否自动重载
|
||||
RELOAD: bool = False
|
||||
# 是否调试模式
|
||||
DEBUG: bool = False
|
||||
# 配置文件目录
|
||||
CONFIG_DIR: str = None
|
||||
# 超级管理员
|
||||
|
||||
@@ -173,6 +173,19 @@ class MediaInfo:
|
||||
def __setattr__(self, name: str, value: Any):
|
||||
self.__dict__[name] = value
|
||||
|
||||
def from_dict(self, data: dict):
|
||||
"""
|
||||
从字典中初始化
|
||||
"""
|
||||
for key, value in data.items():
|
||||
if key == "type":
|
||||
if value == MediaType.MOVIE.value:
|
||||
setattr(self, key, MediaType.MOVIE)
|
||||
elif value == MediaType.TV.value:
|
||||
setattr(self, key, MediaType.TV)
|
||||
continue
|
||||
setattr(self, key, value)
|
||||
|
||||
def set_image(self, name: str, image: str):
|
||||
"""
|
||||
设置图片地址
|
||||
|
||||
Reference in New Issue
Block a user