feat(ssulbox): 공식 링크 오버레이 추가 및 AI 브리핑 대기 제거
This commit is contained in:
1 parent
934410a83b
commit
6d46614dcd
8 files changed
+107
-32
No files matched your search
@@ -42,7 +42,6 @@ async def create_task(
|
||||
*,
|
||||
user_uuid: str,
|
||||
scenario: str,
|
||||
input_text: str,
|
||||
scenes: int,
|
||||
seconds: int,
|
||||
store_name: Optional[str] = None,
|
||||
@@ -65,7 +64,6 @@ async def create_task(
|
||||
row = SsulContent(
|
||||
user_uuid=user_uuid,
|
||||
scenario=scenario,
|
||||
input=input_text,
|
||||
scenes=scenes,
|
||||
seconds=seconds,
|
||||
status=SsulTaskStatus.QUEUED.value,
|
||||
@@ -217,15 +215,15 @@ async def fail_task(
|
||||
|
||||
async def get_place_info(
|
||||
session: AsyncSession, content_id: int
|
||||
) -> tuple[Optional[str], Optional[str], Optional[str]]:
|
||||
"""(store_name, region, detail_region_info).
|
||||
) -> tuple[Optional[str], Optional[str], Optional[str], Optional[str]]:
|
||||
"""(store_name, region, detail_region_info, official_site_url).
|
||||
|
||||
크롤링으로 채울 값이 남았는지 판단하는 데 쓴다.
|
||||
"""
|
||||
row = await session.get(SsulContent, content_id)
|
||||
if row is None:
|
||||
return None, None, None
|
||||
return row.store_name, row.region, row.detail_region_info
|
||||
return None, None, None, None
|
||||
return row.store_name, row.region, row.detail_region_info, row.official_site_url
|
||||
|
||||
|
||||
async def set_place_info(
|
||||
@@ -235,10 +233,14 @@ async def set_place_info(
|
||||
store_name: Optional[str] = None,
|
||||
region: Optional[str] = None,
|
||||
detail_region_info: Optional[str] = None,
|
||||
official_site_url: Optional[str] = None,
|
||||
) -> Optional[SsulContent]:
|
||||
"""크롤링으로 얻은 업장 정보를 채운다. **이미 있는 값은 덮지 않는다.**
|
||||
|
||||
사용자가 검색으로 직접 고른 값이 크롤링 추정치보다 정확하므로 우선한다.
|
||||
|
||||
`official_site_url` 만 예외로 덮어쓴다 — 호출부가 플레이스 URL 을 먼저 폴백으로
|
||||
넣어 두고 크롤링에 성공하면 진짜 홈페이지로 승급시키기 때문이다.
|
||||
"""
|
||||
row = await session.get(SsulContent, content_id)
|
||||
if row is None:
|
||||
@@ -249,9 +251,12 @@ async def set_place_info(
|
||||
row.region = region
|
||||
if detail_region_info and not row.detail_region_info:
|
||||
row.detail_region_info = detail_region_info
|
||||
if official_site_url:
|
||||
row.official_site_url = official_site_url[:2048]
|
||||
logger.info(
|
||||
f"[set_place_info] id={content_id} store={row.store_name!r} "
|
||||
f"region={row.region!r} detail={(row.detail_region_info or '')[:30]!r}"
|
||||
f"region={row.region!r} detail={(row.detail_region_info or '')[:30]!r} "
|
||||
f"site={(row.official_site_url or '')[:60]!r}"
|
||||
)
|
||||
return row
|
||||
|
||||
|
||||
Reference in new issue
Block a user