mirror of
https://github.com/zoriya/Aeris.git
synced 2026-06-05 19:46:02 +00:00
Adding more scopes for spotify
This commit is contained in:
+2
-1
@@ -62,7 +62,8 @@ urlHandler Spotify (Just r) = do
|
||||
clientId <- liftIO $ envAsString "SPOTIFY_CLIENT_ID" ""
|
||||
backRedirect <- liftIO $ envAsString "BACK_URL" ""
|
||||
throwError $ err302 { errHeaders =
|
||||
[("Location", B8.pack $ "https://accounts.spotify.com/authorize?response_type=code&scope=user-library-read user-library-write&client_id=" ++ clientId ++ "&redirect_uri=" ++ backRedirect ++ "auth/redirect" ++ "&state=" ++ r)] }
|
||||
[("Location", B8.pack $ "https://accounts.spotify.com/authorize?response_type=code&scope=user-library-read user-library-modify streaming playlist-modify-private playlist-read-collaborative playlist-read-private playlist-modify-public user-modify-playback-state user-read-private&client_id=" ++ clientId ++ "&redirect_uri=" ++ backRedirect ++ "auth/redirect" ++ "&state=" ++ r)] }
|
||||
|
||||
urlHandler Github (Just r) = do
|
||||
clientId <- liftIO $ envAsString "GITHUB_CLIENT_ID" ""
|
||||
backRedirect <- liftIO $ envAsString "BACK_URL" ""
|
||||
|
||||
@@ -73,7 +73,11 @@ export class Spotify extends BaseService {
|
||||
async playTrack(params: any): Promise<PipelineEnv> {
|
||||
await this._refreshIfNeeded();
|
||||
let track = await this._searchTrack(params['artist'], params['track']);
|
||||
await this._spotify.play({uris: [track.uri]});
|
||||
try {
|
||||
await this._spotify.play({uris: [track.uri]});
|
||||
} catch (e) {
|
||||
throw new Error("Spotify premium is required.");
|
||||
}
|
||||
return {
|
||||
URL: track.uri,
|
||||
ARTIST: track.artists?.[0].name,
|
||||
|
||||
Reference in New Issue
Block a user