Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

support intl tenor links (#2438)

* support intl tenor links

* update test cases

authored by

Hailey and committed by
GitHub
928a626c 9eeff2cc

+13 -2
+8
__tests__/lib/string.test.ts
··· 455 455 'https://tenor.com/notView/gifId', 456 456 'https://tenor.com/view', 457 457 'https://tenor.com/view/gifId.gif', 458 + 'https://tenor.com/intl/view/gifId.gif', 458 459 ] 459 460 460 461 const outputs = [ ··· 741 742 isGif: true, 742 743 hideDetails: true, 743 744 playerUri: 'https://tenor.com/view/gifId.gif', 745 + }, 746 + { 747 + type: 'tenor_gif', 748 + source: 'tenor', 749 + isGif: true, 750 + hideDetails: true, 751 + playerUri: 'https://tenor.com/intl/view/gifId.gif', 744 752 }, 745 753 ] 746 754
+5 -2
src/lib/strings/embed-player.ts
··· 319 319 } 320 320 321 321 if (urlp.hostname === 'tenor.com' || urlp.hostname === 'www.tenor.com') { 322 - const [_, path, filename] = urlp.pathname.split('/') 322 + const [_, pathOrIntl, pathOrFilename, intlFilename] = 323 + urlp.pathname.split('/') 324 + const isIntl = pathOrFilename === 'view' 325 + const filename = isIntl ? intlFilename : pathOrFilename 323 326 324 - if (path === 'view' && filename) { 327 + if ((pathOrIntl === 'view' || pathOrFilename === 'view') && filename) { 325 328 const includesExt = filename.split('.').pop() === 'gif' 326 329 327 330 return {