@@ -158,9 +158,14 @@ export interface BackendCatalogStopItem {
|
||||
hasAudio?: boolean | null
|
||||
audioStatus?: string | null
|
||||
supportedLanguages?: string[] | null
|
||||
hasTextRecord?: boolean | null
|
||||
playTargetType?: string | null
|
||||
playTargetId?: string | number | null
|
||||
audioOptions?: Array<{
|
||||
version?: string | null
|
||||
languageCode?: string | null
|
||||
languageName?: string | null
|
||||
gender?: string | null
|
||||
displayName?: string | null
|
||||
isDefault?: boolean | null
|
||||
}> | null
|
||||
}
|
||||
|
||||
export interface BackendExplainAdapterResult {
|
||||
@@ -339,8 +344,6 @@ export const toCatalogGuideStop = (
|
||||
const id = stringifyId(source.stopId) || stringifyId(source.id)
|
||||
if (!id) return null
|
||||
|
||||
const playTargetType = normalizeAudioTargetType(source.playTargetType) || 'STOP'
|
||||
const playTargetId = stringifyId(source.playTargetId) || id
|
||||
const imageStatus = firstText(source.imageStatus) || 'MISSING'
|
||||
const canUseStopImage = imageStatus === 'READY'
|
||||
|
||||
@@ -350,8 +353,6 @@ export const toCatalogGuideStop = (
|
||||
hallId: hall?.id,
|
||||
hallName: hall?.name,
|
||||
floorId: stringifyId(source.floorId) || hall?.floorId,
|
||||
targetType: playTargetType,
|
||||
targetId: playTargetId,
|
||||
coverImageUrl: canUseStopImage
|
||||
? normalizeSameOriginPublicUrl(firstText(source.coverImageUrl)) || undefined
|
||||
: undefined,
|
||||
@@ -359,7 +360,6 @@ export const toCatalogGuideStop = (
|
||||
hasAudio: source.hasAudio === true,
|
||||
audioStatus: normalizeCatalogAudioStatus(source.audioStatus),
|
||||
supportedLanguages: normalizeSupportedLanguages(source.supportedLanguages),
|
||||
hasTextRecord: source.hasTextRecord === true,
|
||||
poiId: stringifyId(source.poiId) || undefined,
|
||||
mapX: normalizeNumber(source.mapX),
|
||||
mapY: normalizeNumber(source.mapY),
|
||||
@@ -373,8 +373,27 @@ export const toCatalogGuideStop = (
|
||||
linkedExhibits: (source.linkedExhibits || [])
|
||||
.map(toCatalogLinkedExhibitSummary)
|
||||
.filter(Boolean) as NonNullable<ExplainGuideStop['linkedExhibits']>,
|
||||
playTargetType,
|
||||
playTargetId
|
||||
stopId: id,
|
||||
// Catalog audio metadata is intentionally display-only: playback always
|
||||
// comes from the unified stop detail and therefore has no URL here.
|
||||
audioOptions: (source.audioOptions || [])
|
||||
.map((option) => {
|
||||
const gender = option.gender?.trim().toLowerCase()
|
||||
if (gender !== 'male' && gender !== 'female') return null
|
||||
const languageCode = normalizeGuideAudioLanguage(option.languageCode)
|
||||
const version = option.version?.trim().toLowerCase() === 'extended' ? 'extended' : 'standard'
|
||||
return {
|
||||
channelCode: `${version}.${languageCode}.${gender}`,
|
||||
version,
|
||||
languageCode,
|
||||
languageName: firstText(option.languageName) || undefined,
|
||||
gender,
|
||||
displayName: firstText(option.displayName) || undefined,
|
||||
playUrl: '',
|
||||
isDefault: option.isDefault === true
|
||||
}
|
||||
})
|
||||
.filter(Boolean) as NonNullable<ExplainGuideStop['audioOptions']>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -404,15 +423,15 @@ export const toCatalogMuseumExhibitFromStop = (
|
||||
audioAvailable: audioReady,
|
||||
audioStatus: stop.audioStatus,
|
||||
supportedLanguages: stop.supportedLanguages,
|
||||
audioHasText: stop.hasTextRecord,
|
||||
// List summaries do not carry authoritative text availability. It is read
|
||||
// from the unified detail together with the full text variants.
|
||||
audioHasText: false,
|
||||
imageStatus: stop.imageStatus,
|
||||
linkedExhibitCount: stop.linkedExhibitCount,
|
||||
isSharedStop: stop.isSharedStop,
|
||||
linkedExhibits: stop.linkedExhibits,
|
||||
stopInfoAvailable: true,
|
||||
resolvedStopId: stop.id,
|
||||
playTargetType: stop.playTargetType || stop.targetType || 'STOP',
|
||||
playTargetId: stop.playTargetId || stop.targetId || stop.id
|
||||
resolvedStopId: stop.id
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user