fedimbed.bluesky: nullcheck
This commit is contained in:
		
							parent
							
								
									37f2224ad2
								
							
						
					
					
						commit
						f011a4bc8f
					
				
					 1 changed files with 4 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -383,7 +383,7 @@ async function blueskyQuoteEmbed(quote) {
 | 
			
		|||
        const domain = lookup.service.find((service) => service.id === "#atproto_pds").serviceEndpoint;
 | 
			
		||||
        const videoUrl = `${domain}/xrpc/com.atproto.sync.getBlob?did=${quote.author.did}&cid=${embed.cid}`;
 | 
			
		||||
 | 
			
		||||
        videos.push({media: {url: videoUrl}, description: embed.alt.length > 0 ? embed.alt : null});
 | 
			
		||||
        videos.push({media: {url: videoUrl}, description: embed.alt?.length > 0 ? embed.alt : null});
 | 
			
		||||
        break;
 | 
			
		||||
      }
 | 
			
		||||
      case "app.bsky.embed.recordWithMedia#view": {
 | 
			
		||||
| 
						 | 
				
			
			@ -399,7 +399,7 @@ async function blueskyQuoteEmbed(quote) {
 | 
			
		|||
          const domain = lookup.service.find((service) => service.id === "#atproto_pds").serviceEndpoint;
 | 
			
		||||
          const videoUrl = `${domain}/xrpc/com.atproto.sync.getBlob?did=${quote.author.did}&cid=${embed.media.cid}`;
 | 
			
		||||
 | 
			
		||||
          videos.push({media: {url: videoUrl}, description: embed.alt.length > 0 ? embed.alt : null});
 | 
			
		||||
          videos.push({media: {url: videoUrl}, description: embed.alt?.length > 0 ? embed.alt : null});
 | 
			
		||||
        }
 | 
			
		||||
        break;
 | 
			
		||||
      }
 | 
			
		||||
| 
						 | 
				
			
			@ -520,7 +520,7 @@ async function bluesky(msg, url, spoiler = false) {
 | 
			
		|||
        const domain = lookup.service.find((service) => service.id === "#atproto_pds").serviceEndpoint;
 | 
			
		||||
        const videoUrl = `${domain}/xrpc/com.atproto.sync.getBlob?did=${post.author.did}&cid=${post.embed.cid}`;
 | 
			
		||||
 | 
			
		||||
        videos.push({media: {url: videoUrl}, description: post.embed.alt.length > 0 ? post.embed.alt : null});
 | 
			
		||||
        videos.push({media: {url: videoUrl}, description: post.embed.alt?.length > 0 ? post.embed.alt : null});
 | 
			
		||||
        break;
 | 
			
		||||
      }
 | 
			
		||||
      case "app.bsky.embed.record#view": {
 | 
			
		||||
| 
						 | 
				
			
			@ -550,7 +550,7 @@ async function bluesky(msg, url, spoiler = false) {
 | 
			
		|||
          const domain = lookup.service.find((service) => service.id === "#atproto_pds").serviceEndpoint;
 | 
			
		||||
          const videoUrl = `${domain}/xrpc/com.atproto.sync.getBlob?did=${post.author.did}&cid=${post.embed.media.cid}`;
 | 
			
		||||
 | 
			
		||||
          videos.push({media: {url: videoUrl}, description: post.embed.alt.length > 0 ? post.embed.alt : null});
 | 
			
		||||
          videos.push({media: {url: videoUrl}, description: post.embed.alt?.length > 0 ? post.embed.alt : null});
 | 
			
		||||
        } else if (post.embed.media.$type === "app.bsky.embed.external#view") {
 | 
			
		||||
          if (post.embed.media.external.uri.includes("tenor.com")) {
 | 
			
		||||
            const url = new URL(post.embed.media.external.uri);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue