From 50268bdc2fa533f5f986805718074055b7ce12af Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Fri, 28 Jul 2023 03:11:18 +0200 Subject: [PATCH] chore(frontend): support Spotify for brainDiver --- .../frontend/src/components/MkPostForm.vue | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue index f1eac354ea..e85eca1c48 100644 --- a/packages/frontend/src/components/MkPostForm.vue +++ b/packages/frontend/src/components/MkPostForm.vue @@ -755,14 +755,19 @@ async function post(ev?: MouseEvent) { if ((text.includes('love') || text.includes('❤')) && text.includes('misskey')) { claimAchievement('iLoveMisskey'); } - if ( - text.includes('https://youtu.be/Efrlqw8ytg4'.toLowerCase()) || - text.includes('https://www.youtube.com/watch?v=Efrlqw8ytg4'.toLowerCase()) || - text.includes('https://m.youtube.com/watch?v=Efrlqw8ytg4'.toLowerCase()) || - text.includes('https://youtu.be/XVCwzwxdHuA'.toLowerCase()) || - text.includes('https://www.youtube.com/watch?v=XVCwzwxdHuA'.toLowerCase()) || - text.includes('https://m.youtube.com/watch?v=XVCwzwxdHuA'.toLowerCase()) - ) { + if ([ + 'https://youtu.be/Efrlqw8ytg4', + 'https://www.youtube.com/watch?v=Efrlqw8ytg4', + 'https://m.youtube.com/watch?v=Efrlqw8ytg4', + + 'https://youtu.be/XVCwzwxdHuA', + 'https://www.youtube.com/watch?v=XVCwzwxdHuA', + 'https://m.youtube.com/watch?v=XVCwzwxdHuA', + + 'https://open.spotify.com/track/3Cuj0mZrlLoXx9nydNi7RB?si=b45a46c0b622462c', + 'https://open.spotify.com/track/7anfcaNPQWlWCwyCHmZqNy?si=1705919f63c64bfb', + 'https://open.spotify.com/track/5Odr16TvEN4my22K9nbH7l?si=2eb7e7bed887409c', + ].some(url => text.includes(url.toLowerCase())) { claimAchievement('brainDiver'); }