-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'raycast:main' into ext/beeminder
- Loading branch information
Showing
29 changed files
with
420 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"version": "1.91.2" | ||
"version": "1.92.1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { showHUD } from "@raycast/api"; | ||
import { setSpotifyClient } from "./helpers/withSpotifyClient"; | ||
import { getCurrentlyPlaying } from "./api/getCurrentlyPlaying"; | ||
import { safeLaunchCommandInBackground } from "./helpers/safeCommandLauncher"; | ||
import { seek } from "./api/seek"; | ||
|
||
export default async function Command() { | ||
await setSpotifyClient(); | ||
|
||
const currentlyPlayingData = await getCurrentlyPlaying(); | ||
const nothingIsPlaying = !currentlyPlayingData || !currentlyPlayingData.item; | ||
|
||
if (nothingIsPlaying) { | ||
return await showHUD("Nothing is currently playing"); | ||
} | ||
|
||
try { | ||
const currentPositionSeconds = (currentlyPlayingData?.progress_ms || 0) / 1000; | ||
await seek(Math.max(currentPositionSeconds - 15, 0)); | ||
await showHUD("Skipped back 15 seconds"); | ||
await safeLaunchCommandInBackground("current-track"); | ||
} catch (error) { | ||
await showHUD("Nothing is currently playing"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { Clipboard, showHUD } from "@raycast/api"; | ||
import { setSpotifyClient } from "./helpers/withSpotifyClient"; | ||
import { getCurrentlyPlaying } from "./api/getCurrentlyPlaying"; | ||
|
||
export default async function Command() { | ||
await setSpotifyClient(); | ||
|
||
const currentlyPlayingData = await getCurrentlyPlaying(); | ||
const nothingIsPlaying = !currentlyPlayingData || !currentlyPlayingData.item; | ||
|
||
if (nothingIsPlaying) { | ||
return await showHUD("Nothing is currently playing"); | ||
} | ||
|
||
const external_urls = currentlyPlayingData.item.external_urls; | ||
const spotifyUrl = external_urls?.spotify; | ||
|
||
const embedUrl = spotifyUrl?.replace("open.spotify.com/", "open.spotify.com/embed/"); | ||
|
||
const embedCode = `<iframe style="border-radius:12px" src="${embedUrl}?utm_source=generator" width="100%" height="352" frameBorder="0" allowfullscreen="" allow="autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture" loading="lazy"></iframe>`; | ||
|
||
await Clipboard.copy(embedCode); | ||
return showHUD("Copied embed code to clipboard"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.