77 lines
2.8 KiB
TypeScript
77 lines
2.8 KiB
TypeScript
// Metro module 8175 (f8176).
|
|
import { PlatformTypes } from "../../Constants";
|
|
import Platforms from "../../lib/Platforms";
|
|
import { isAndroid } from "../../utils/PlatformUtils";
|
|
let c5191_0 = "spotify";
|
|
let c5191_1 = "spotify:";
|
|
const name = Platforms.get(PlatformTypes.SPOTIFY).name;
|
|
let c5191_2 = {
|
|
TRACK: "track",
|
|
ARTIST: "artist",
|
|
ALBUM: "album",
|
|
PLAYLIST: "playlist",
|
|
EPISODE: "episode",
|
|
SHOW: "show"
|
|
};
|
|
const r36 = {
|
|
USER_ACTIVITY_PLAY: "user_activity_play",
|
|
USER_ACTIVITY_SYNC: "user_activity_sync",
|
|
EMBED_SYNC: "embed_sync"
|
|
};
|
|
const r85 = Object.freeze({
|
|
PROFILE: `https://api.spotify.com/v1/me`,
|
|
NOTIFICATIONS_PLAYER: `https://api.spotify.com/v1/me/notifications/player`,
|
|
PLAYER: `https://api.spotify.com/v1/me/player`,
|
|
PLAYER_DEVICES: `https://api.spotify.com/v1/me/player/devices`,
|
|
PLAYER_PLAY: `https://api.spotify.com/v1/me/player/play`,
|
|
PLAYER_PAUSE: `https://api.spotify.com/v1/me/player/pause`,
|
|
PLAYER_REPEAT: `https://api.spotify.com/v1/me/player/repeat`,
|
|
WEB_OPEN: function WEB_OPEN(a0, a1, r4 = "desktop") {
|
|
return `https://open.spotify.com/${encodeURIComponent(a0)}/${encodeURIComponent(a1)}${`?utm_source=discord&utm_medium=${r4}`}`;
|
|
},
|
|
EMBED: function EMBED(a0, r5 = "desktop") {
|
|
return `https://open.spotify.com/embed${a0}${`?utm_source=discord&utm_medium=${r5}`}`;
|
|
},
|
|
PLAYER_OPEN: function PLAYER_OPEN(a0, a1, r3 = true, r10 = "desktop") {
|
|
return `${c5191_0}:${encodeURIComponent(a0)}:${encodeURIComponent(a1)}${r3 ? `?utm_source=discord&utm_medium=${r10}` : ""}`;
|
|
},
|
|
PREMIUM_SITE: `https://www.spotify.com/premium/${`?utm_source=discord&utm_medium=desktop`}`,
|
|
INSTALL_ATTRIBUTION: (a0) => `https://app.adjust.com/bdyga9?campaign=${a0}`,
|
|
APP_STORE: isAndroid() ? "https://play.google.com/store/apps/details?id=com.spotify.music&hl=en_US&gl=US" : "https://itunes.apple.com/us/app/spotify-music/id324684580?mt=8",
|
|
IOS_APP_STORE: "https://itunes.apple.com/us/app/spotify-music/id324684580?mt=8"
|
|
});
|
|
export const SPOTIFY_APP_PROTOCOL = "spotify";
|
|
export const SPOTIFY_PARTY_PREFIX = "spotify:";
|
|
export { name as SPOTIFY_PLATFORM_NAME };
|
|
export function isSpotifyParty(a0) {
|
|
return a0 != null && a0.startsWith(c5191_1);
|
|
}
|
|
export { c5191_2 as SpotifyResourceTypes };
|
|
export { r36 as SpotifyActionTypes };
|
|
export const SPOTIFY_HOSTNAMES = ["open.spotify.com", "www.spotify.com"];
|
|
export { r85 as SpotifyEndpoints };
|
|
export function getSpotifyResourceType(a0) {
|
|
if (typeof a0 !== "string") {
|
|
return null;
|
|
}
|
|
if (a0 === "track") {
|
|
return c5191_2.TRACK;
|
|
}
|
|
if (a0 === "artist") {
|
|
return c5191_2.ARTIST;
|
|
}
|
|
if (a0 === "album") {
|
|
return c5191_2.ALBUM;
|
|
}
|
|
if (a0 === "playlist") {
|
|
return c5191_2.PLAYLIST;
|
|
}
|
|
if (a0 === "episode") {
|
|
return c5191_2.EPISODE;
|
|
}
|
|
if (a0 === "show") {
|
|
return c5191_2.SHOW;
|
|
}
|
|
return null;
|
|
}
|