debug: add detailed logging for template filtering

Add console logs to track template filtering process on home and video pages to diagnose black screen issue. Logs include all preview URL fields and filtering decisions.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
imeepos 2026-01-21 15:20:58 +08:00
parent a344410374
commit 0b344b6b5f
2 changed files with 12 additions and 1 deletions

View File

@ -144,6 +144,14 @@ export default function HomeScreen() {
// 过滤掉视频类型的模板,只显示图片
const previewUrl = (template as any).webpPreviewUrl || template.previewUrl || template.coverImageUrl || ``
const isVideo = previewUrl.includes('.mp4') || previewUrl.includes('.mov') || previewUrl.includes('.webm')
console.log(`[HOME PAGE] Filtering ${template.title}:`, {
webpPreviewUrl: (template as any).webpPreviewUrl,
previewUrl: template.previewUrl,
coverImageUrl: template.coverImageUrl,
finalPreviewUrl: previewUrl,
isVideo,
shouldKeep: !isVideo
})
return !isVideo
})
: []

View File

@ -169,7 +169,10 @@ export default function VideoScreen() {
// 有显示URL且不是视频格式才保留
const shouldKeep = !!displayUrl && !isDisplayVideo
console.log(`Filtering ${item.title}:`, {
console.log(`[VIDEO PAGE] Filtering ${item.title}:`, {
webpHighPreviewUrl: item.webpHighPreviewUrl,
webpPreviewUrl: item.webpPreviewUrl,
previewUrl: item.previewUrl,
displayUrl,
isDisplayVideo,
shouldKeep,