@@ -170,7 +170,6 @@ const LayoutSlug = props => {
170
170
assetWrappers . forEach ( ( wrapper , index ) => {
171
171
// 检查 .notion-asset-wrapper 元素是否有子元素 figcaption
172
172
const figCaption = wrapper . querySelector ( 'figcaption' )
173
- if ( ! figCaption ) return // 如果没有子元素 figcaption,则不处理该元素
174
173
175
174
// 检查 .notion-asset-wrapper 元素是否有 notion-asset-wrapper-video 或 notion-asset-wrapper-embed 类
176
175
if (
@@ -179,8 +178,10 @@ const LayoutSlug = props => {
179
178
)
180
179
return
181
180
181
+ if ( ! figCaption && siteConfig ( 'MOVIE_VIDEO_COMBINE_AUTO' , false , CONFIG ) ) return // 如果没有子元素 figcaption,则不处理该元素
182
+
182
183
// 获取 figcaption 的文本内容并添加到数组中
183
- const figCaptionValue = figCaption . textContent . trim ( )
184
+ const figCaptionValue = figCaption ? figCaption ? .textContent ? .trim ( ) : `P- ${ index } `
184
185
figCaptionValues . push ( figCaptionValue )
185
186
186
187
// 创建一个新的 div 元素用于包裹当前的 .notion-asset-wrapper 元素
@@ -223,13 +224,14 @@ const LayoutSlug = props => {
223
224
figCaptionWrapper . appendChild ( div )
224
225
} )
225
226
226
- // 条件是带有caption的视频数量大于1个,否则不处理
227
- if ( figCaptionValues . length > 1 ) {
228
- // 将包含 figcaption 值的容器元素添加到 notion-article 的第一个子元素插入
229
- videoWrapper . appendChild ( carouselWrapper )
227
+ // 将包含 figcaption 值的容器元素添加到 notion-article 的第一个子元素插入
228
+ videoWrapper . appendChild ( carouselWrapper )
229
+ // 显示分集按钮 ,caption的视频数量大于1个
230
+ if ( figCaptionValues . length > 1 || siteConfig ( 'MOVIE_VIDEO_COMBINE_SHOW_PAGE_FORCE' , false , CONFIG ) ) {
230
231
videoWrapper . appendChild ( figCaptionWrapper )
231
- notionArticle . insertBefore ( videoWrapper , notionArticle . firstChild )
232
232
}
233
+
234
+ notionArticle . insertBefore ( videoWrapper , notionArticle . firstChild )
233
235
}
234
236
235
237
setTimeout ( ( ) => {
0 commit comments