mirror of
https://github.com/tcsenpai/pensieve.git
synced 2025-06-06 03:05:25 +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
|
||||
default_library = response.json()
|
||||
|
||||
for plugin in settings.default_plugins:
|
||||
bind(default_library["id"], plugin)
|
||||
|
||||
# Check if the library is empty
|
||||
if not default_library["folders"]:
|
||||
# Add the screenshots directory to the library
|
||||
|
@ -1,6 +1,6 @@
|
||||
import os
|
||||
from pathlib import Path
|
||||
from typing import Tuple, Type
|
||||
from typing import Tuple, Type, List
|
||||
from pydantic_settings import (
|
||||
BaseSettings,
|
||||
PydanticBaseSettingsSource,
|
||||
@ -78,6 +78,8 @@ class Settings(BaseSettings):
|
||||
auth_username: str = "admin"
|
||||
auth_password: SecretStr = SecretStr("changeme")
|
||||
|
||||
default_plugins: List[str] = ["builtin_vlm", "builtin_ocr"]
|
||||
|
||||
@classmethod
|
||||
def settings_customise_sources(
|
||||
cls,
|
||||
|
@ -178,10 +178,10 @@ def init_database():
|
||||
def initialize_default_plugins(session):
|
||||
default_plugins = [
|
||||
PluginModel(
|
||||
name="buildin_vlm", description="VLM Plugin", webhook_url="/plugins/vlm"
|
||||
name="builtin_vlm", description="VLM Plugin", webhook_url="/plugins/vlm"
|
||||
),
|
||||
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