1- import { getStorage , Lodash as _ , log } from "@nsnanocat/util" ;
1+ import { Console , getStorage , Lodash as _ } from "@nsnanocat/util" ;
22
33/**
44 * Set Environment Variables
@@ -10,19 +10,20 @@ import { getStorage, Lodash as _, log } from "@nsnanocat/util";
1010 * @return {Object } { Settings, Caches, Configs }
1111 */
1212export default function setENV ( name , platforms , database ) {
13- log ( ` ☑️ Set Environment Variables` , " ") ;
14- let { Settings, Caches, Configs } = getStorage ( name , platforms , database ) ;
13+ Console . log ( " ☑️ Set Environment Variables") ;
14+ const { Settings, Caches, Configs } = getStorage ( name , platforms , database ) ;
1515 /***************** Settings *****************/
1616 if ( ! Array . isArray ( Settings ?. Types ) ) Settings . Types = ( Settings . Types ) ? [ Settings . Types ] : [ ] ; // 只有一个选项时,无逗号分隔
17- log ( `✅ Set Environment Variables, Settings: ${ typeof Settings } , Settings内容 : ${ JSON . stringify ( Settings ) } `, "" ) ;
17+ Console . debug ( `typeof Settings: ${ typeof Settings } ` , `Settings : ${ JSON . stringify ( Settings ) } `) ;
1818 /***************** Caches *****************/
19- //log(`✅ Set Environment Variables, Caches: ${typeof Caches}, Caches内容 : ${JSON.stringify(Caches)}`, "" );
19+ //Console.debug(`typeof Caches: ${typeof Caches}`, `Caches : ${JSON.stringify(Caches)}`);
2020 if ( typeof Caches ?. Playlists !== "object" || Array . isArray ( Caches ?. Playlists ) ) Caches . Playlists = { } ; // 创建Playlists缓存
2121 Caches . Playlists . Master = new Map ( JSON . parse ( Caches ?. Playlists ?. Master || "[]" ) ) ; // Strings转Array转Map
2222 Caches . Playlists . Subtitle = new Map ( JSON . parse ( Caches ?. Playlists ?. Subtitle || "[]" ) ) ; // Strings转Array转Map
2323 if ( typeof Caches ?. Subtitles !== "object" ) Caches . Subtitles = new Map ( JSON . parse ( Caches ?. Subtitles || "[]" ) ) ; // Strings转Array转Map
2424 if ( typeof Caches ?. Metadatas !== "object" || Array . isArray ( Caches ?. Metadatas ) ) Caches . Metadatas = { } ; // 创建Playlists缓存
2525 if ( typeof Caches ?. Metadatas ?. Tracks !== "object" ) Caches . Metadatas . Tracks = new Map ( JSON . parse ( Caches ?. Metadatas ?. Tracks || "[]" ) ) ; // Strings转Array转Map
2626 /***************** Configs *****************/
27+ Console . log ( "✅ Set Environment Variables" ) ;
2728 return { Settings, Caches, Configs } ;
2829} ;
0 commit comments