From a3fb8ebfff869a9cadcc8ce8278e3ffd50e045a5 Mon Sep 17 00:00:00 2001 From: Rahul Ahuja Date: Wed, 4 Sep 2019 22:56:09 -0700 Subject: [PATCH] Formatting --- beetsplug/deezer.py | 3 ++- beetsplug/spotify.py | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/beetsplug/deezer.py b/beetsplug/deezer.py index bd25f8ecc..886978536 100644 --- a/beetsplug/deezer.py +++ b/beetsplug/deezer.py @@ -29,12 +29,13 @@ from beets.autotag.hooks import AlbumInfo, TrackInfo class DeezerPlugin(APIAutotaggerPlugin): + data_source = 'Deezer' + # Base URLs for the Deezer API # Documentation: https://developers.deezer.com/api/ search_url = 'https://api.deezer.com/search/' album_url = 'https://api.deezer.com/album/' track_url = 'https://api.deezer.com/track/' - data_source = 'Deezer' id_regex = { 'pattern': r'(^|deezer\.com/([a-z]*/)?{}/)([0-9]*)', 'match_group': 3, diff --git a/beetsplug/spotify.py b/beetsplug/spotify.py index 3ec576bbc..35ae7e462 100644 --- a/beetsplug/spotify.py +++ b/beetsplug/spotify.py @@ -35,6 +35,8 @@ from beets.autotag.hooks import AlbumInfo, TrackInfo class SpotifyPlugin(APIAutotaggerPlugin): + data_source = 'Spotify' + # Base URLs for the Spotify API # Documentation: https://developer.spotify.com/web-api oauth_token_url = 'https://accounts.spotify.com/api/token' @@ -42,8 +44,6 @@ class SpotifyPlugin(APIAutotaggerPlugin): search_url = 'https://api.spotify.com/v1/search' album_url = 'https://api.spotify.com/v1/albums/' track_url = 'https://api.spotify.com/v1/tracks/' - playlist_partial = 'spotify:trackset:Playlist:' - data_source = 'Spotify' # Spotify IDs consist of 22 alphanumeric characters # (zero-left-padded base62 representation of randomly generated UUID4) @@ -515,7 +515,9 @@ class SpotifyPlugin(APIAutotaggerPlugin): self.data_source ) ) - spotify_url = self.playlist_partial + ",".join(spotify_ids) + spotify_url = 'spotify:trackset:Playlist:' + ','.join( + spotify_ids + ) webbrowser.open(spotify_url) else: for spotify_id in spotify_ids: