feat: public_url photobooth pour les medias dans la galerie
This commit is contained in:
@@ -23,9 +23,10 @@ class AppConfig:
|
||||
|
||||
@dataclass
|
||||
class PhotoboothConfig:
|
||||
base_url: str = "http://localhost:8083"
|
||||
base_url: str = "http://localhost:8000"
|
||||
public_url: str = "" # URL publique pour les medias (ex: https://photobooth.lessapinsduweb.com)
|
||||
data_dir: str = "/home/pi/photobooth-data"
|
||||
config_file: str = "/home/pi/.config/photobooth-app/config.json"
|
||||
config_file: str = "/home/pi/photobooth-data/config/config.json"
|
||||
media_dir: str = "/home/pi/photobooth-data/media/processed_full"
|
||||
userdata_dir: str = "/home/pi/photobooth-data/userdata"
|
||||
show_delete_button: bool = False
|
||||
|
||||
@@ -71,10 +71,12 @@ class PhotoboothService:
|
||||
return False
|
||||
|
||||
def media_url(self, identifier: str) -> str:
|
||||
return f"{self._base}/media/full/{identifier}"
|
||||
base = (self._cfg.public_url.rstrip("/") or self._base)
|
||||
return f"{base}/media/full/{identifier}"
|
||||
|
||||
def thumbnail_url(self, identifier: str) -> str:
|
||||
return f"{self._base}/media/thumbnail/{identifier}"
|
||||
base = (self._cfg.public_url.rstrip("/") or self._base)
|
||||
return f"{base}/media/thumbnail/{identifier}"
|
||||
|
||||
async def read_pb_config(self) -> dict:
|
||||
"""Lit le fichier config.json de photobooth-app."""
|
||||
|
||||
@@ -14,6 +14,7 @@ app:
|
||||
# --- Integration photobooth-app ---
|
||||
photobooth:
|
||||
base_url: "http://localhost:8000"
|
||||
public_url: "https://photobooth.lessapinsduweb.com" # URL publique pour les medias dans la galerie
|
||||
data_dir: "/home/pi/photobooth-data"
|
||||
config_file: "/home/pi/photobooth-data/config/config.json"
|
||||
media_dir: "/home/pi/photobooth-data/media/processed_full"
|
||||
|
||||
Reference in New Issue
Block a user