@@ -11,6 +11,7 @@ getBrowserInstance().browserAction.onClicked.addListener(() => openOptions());
1111getBrowserInstance ( ) . runtime . onMessage . addListener ( async ( message : string | { [ key : string ] : any } ) => {
1212 try {
1313 const msg = parseTypeObject ( message ) ;
14+ console . dev . log ( 'Handling message' , msg ) ;
1415 switch ( msg . type ) {
1516 case BrowserMessage . LOAD_CREATORS :
1617 return console . debug ( await loadCreators ( ) ) ;
@@ -44,12 +45,13 @@ const loadCreators = (() => {
4445} ) ( ) ;
4546
4647const getYoutubeId = async ( message : { [ key : string ] : any } ) => {
47- const { creator, title } = message ;
48+ const { creator, title, nebula } = message ;
4849 const normalizedCreator = normalizeString ( creator ) ;
50+ console . debug ( 'creator:' , creator , '\nnebula:' , nebula , '\ntitle:' , title ) ;
4951
5052 try {
5153 const creators = await loadCreators ( ) ;
52- const uploads = creators . find ( e => e . name === creator || normalizeString ( e . name ) === normalizedCreator ) ?. uploads ;
54+ const uploads = creators . find ( e => e . name === creator || normalizeString ( e . name ) === normalizedCreator || e . nebula === nebula ) ?. uploads ;
5355 return creatorHasYTVideo ( uploads , title , videoFetchYt ) ;
5456 } catch ( err ) {
5557 console . error ( err ) ;
@@ -62,7 +64,7 @@ const getNebulaVideo = async (message: { [key: string]: any }): Promise<nebulavi
6264
6365 const creators = await loadCreators ( ) ;
6466 const creator = creators . find ( c => c . channel === channelID ) ;
65- console . debug ( 'creator:' , creator ) ;
67+ console . debug ( 'creator:' , creator , '\nchannelID:' , channelID , '\nvideoTitle:' , videoTitle ) ;
6668 if ( ! creator ) return ;
6769
6870 // try search the channel's newest videos locally
0 commit comments