File tree Expand file tree Collapse file tree 3 files changed +30
-3
lines changed Expand file tree Collapse file tree 3 files changed +30
-3
lines changed Original file line number Diff line number Diff line change 88permissions : write-all 
99
1010env :
11-   #  是否重新生成 vod/xvod 的 category
12-   VOD_CATES : " 1 " 
11+   #  是否重新生成 vod/xvod 的 category("0" | "1") 
12+   VOD_CATES : " 0 " 
1313
1414jobs :
1515  build-and-deploy :
Original file line number Diff line number Diff line change 1212      "args" : [
1313        " vod.json" 
1414        " xvod.json" 
15-       ]
15+       ],
16+       "env" : {
17+         "VOD_CATES" : " 0" 
18+       }
1619    },
1720    {
1821      "type" : " bun" 
Original file line number Diff line number Diff line change 11import  {  writeFileSync  }  from  'fs' 
22import  {  join  }  from  'path' 
33import  {  getAvailableCategoryWithCfg  }  from  "./vod_utils" 
4+ import  {  req  }  from  "utils" 
45
56const  vods  =  < Iconfig [ ] > [ 
67  { 
@@ -682,6 +683,29 @@ const file2 = join(process.cwd(), nsfwVodFile);
682683        console . error ( error ) 
683684      } 
684685    } 
686+   }  else  { 
687+     const  __vod : Iconfig [ ]  =  JSON . parse ( await  req ( "https://d1y.github.io/kitty/vod.json" ) ) 
688+     const  __xvod : Iconfig [ ]  =  JSON . parse ( await  req ( "https://d1y.github.io/kitty/xvod.json" ) ) 
689+     const  ___vod  =  new  Map ( __vod . map ( item  =>  [ item . id ,  item ] ) ) 
690+     const  ___xvod  =  new  Map ( __xvod . map ( item  =>  [ item . id ,  item ] ) ) 
691+     vods . forEach ( item  =>  { 
692+       const  cx  =  ___vod . get ( item . id ) 
693+       if  ( ! cx )  return 
694+       cx . extra  ??=  { } 
695+       if  ( cx . extra ! . category )  { 
696+         item . extra  ??=  { } 
697+         item . extra . category  =  cx . extra . category 
698+       } 
699+     } ) 
700+     nsfwVods . forEach ( item  =>  { 
701+       const  cx  =  ___xvod . get ( item . id ) 
702+       if  ( ! cx )  return 
703+       cx . extra  ??=  { } 
704+       if  ( cx . extra ! . category )  { 
705+         item . extra  ??=  { } 
706+         item . extra . category  =  cx . extra . category 
707+       } 
708+     } ) 
685709  } 
686710  writeFileSync ( file1 ,  JSON . stringify ( vods ,  null ,  2 ) ) 
687711  writeFileSync ( file2 ,  JSON . stringify ( nsfwVods ,  null ,  2 ) ) 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments