mirror of
https://github.com/tcsenpai/pensieve.git
synced 2025-06-07 03:35:24 +00:00
feat: add builtin plugins for default library
This commit is contained in:
parent
fca387b22d
commit
167fd31053
@ -797,6 +797,9 @@ def scan_default_library(force: bool = False):
|
|||||||
return
|
return
|
||||||
default_library = response.json()
|
default_library = response.json()
|
||||||
|
|
||||||
|
for plugin in settings.default_plugins:
|
||||||
|
bind(default_library["id"], plugin)
|
||||||
|
|
||||||
# Check if the library is empty
|
# Check if the library is empty
|
||||||
if not default_library["folders"]:
|
if not default_library["folders"]:
|
||||||
# Add the screenshots directory to the library
|
# Add the screenshots directory to the library
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import os
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Tuple, Type
|
from typing import Tuple, Type, List
|
||||||
from pydantic_settings import (
|
from pydantic_settings import (
|
||||||
BaseSettings,
|
BaseSettings,
|
||||||
PydanticBaseSettingsSource,
|
PydanticBaseSettingsSource,
|
||||||
@ -78,6 +78,8 @@ class Settings(BaseSettings):
|
|||||||
auth_username: str = "admin"
|
auth_username: str = "admin"
|
||||||
auth_password: SecretStr = SecretStr("changeme")
|
auth_password: SecretStr = SecretStr("changeme")
|
||||||
|
|
||||||
|
default_plugins: List[str] = ["builtin_vlm", "builtin_ocr"]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def settings_customise_sources(
|
def settings_customise_sources(
|
||||||
cls,
|
cls,
|
||||||
|
@ -178,10 +178,10 @@ def init_database():
|
|||||||
def initialize_default_plugins(session):
|
def initialize_default_plugins(session):
|
||||||
default_plugins = [
|
default_plugins = [
|
||||||
PluginModel(
|
PluginModel(
|
||||||
name="buildin_vlm", description="VLM Plugin", webhook_url="/plugins/vlm"
|
name="builtin_vlm", description="VLM Plugin", webhook_url="/plugins/vlm"
|
||||||
),
|
),
|
||||||
PluginModel(
|
PluginModel(
|
||||||
name="buildin_ocr", description="OCR Plugin", webhook_url="/plugins/ocr"
|
name="builtin_ocr", description="OCR Plugin", webhook_url="/plugins/ocr"
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user