1
This commit is contained in:
@@ -283,11 +283,23 @@ async def get_site_info(db: AsyncSession = Depends(get_db)):
|
|||||||
)
|
)
|
||||||
configs = result.scalars().all()
|
configs = result.scalars().all()
|
||||||
info = {c.key: c.value for c in configs}
|
info = {c.key: c.value for c in configs}
|
||||||
|
|
||||||
|
# Helper function to convert relative path to full URL
|
||||||
|
def to_full_url(path: str | None) -> str:
|
||||||
|
if not path:
|
||||||
|
return ""
|
||||||
|
# If already absolute URL, return as-is
|
||||||
|
if path.startswith("http://") or path.startswith("https://"):
|
||||||
|
return path
|
||||||
|
# Convert relative path to full URL
|
||||||
|
base_url = settings.BASE_URL.rstrip("/")
|
||||||
|
return f"{base_url}{path}"
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"site_name": info.get("site_name", "VideoGen.AI"),
|
"site_name": info.get("site_name", "VideoGen.AI"),
|
||||||
"site_logo": info.get("site_logo", ""),
|
"site_logo": to_full_url(info.get("site_logo")),
|
||||||
"user_agreement_url": info.get("user_agreement_url", ""),
|
"user_agreement_url": to_full_url(info.get("user_agreement_url")),
|
||||||
"privacy_policy_url": info.get("privacy_policy_url", ""),
|
"privacy_policy_url": to_full_url(info.get("privacy_policy_url")),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user