@@ -19,20 +19,26 @@ module.exports = async (ctx) => {
1919
2020 const data = response . data ;
2121
22- const items = data . map ( ( item ) => ( {
23- title : item . title ,
24- link : item . content_url ,
25- author : item . column_name ,
26- pubDate : timezone ( parseDate ( item . publish_time ) , + 8 ) ,
27- description : art ( path . join ( __dirname , 'templates/description.art' ) , {
28- type : item . type ,
29- image : item . index_pic ,
30- file : `${ hostUrl } /${ item . target_path } ${ item . target_filename } ` ,
31- } ) ,
32- enclosure_url : `${ hostUrl } /${ item . target_path } ${ item . target_filename } ` ,
33- itunes_duration : item . video . duration ,
34- itunes_item_image : item . index_pic ,
35- } ) ) ;
22+ const items = data . map ( ( item ) => {
23+ const enclosure_url = `${ hostUrl } /${ item . target_path } ${ item . target_filename } ` ;
24+ const enclosure_type = `${ item . type } /${ enclosure_url . match ( / \. ( \w + ) $ / ) [ 1 ] } ` ;
25+
26+ return {
27+ title : item . title ,
28+ link : item . content_url ,
29+ author : item . column_name ,
30+ pubDate : timezone ( parseDate ( item . publish_time ) , + 8 ) ,
31+ description : art ( path . join ( __dirname , 'templates/description.art' ) , {
32+ type : item . type ,
33+ image : item . index_pic ,
34+ file : enclosure_url ,
35+ } ) ,
36+ enclosure_url,
37+ enclosure_type,
38+ itunes_duration : item . video . duration ,
39+ itunes_item_image : item . index_pic ,
40+ } ;
41+ } ) ;
3642
3743 const author = data [ 0 ] . column_name ;
3844 const imageUrl = data [ 0 ] . column_info . indexpic ;
0 commit comments