Fixed pyinstaller spotipy issue and started working on favorites

This commit is contained in:
RemixDev 2020-09-18 13:43:54 +02:00
parent 9603616d33
commit 73684aed45
5 changed files with 30 additions and 8 deletions

View File

@ -1,3 +1,3 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
__version__ = "1.3.8" __version__ = "1.3.9"

View File

@ -23,7 +23,6 @@ class Deezer:
} }
self.album_pictures_host = "https://e-cdns-images.dzcdn.net/images/cover/" self.album_pictures_host = "https://e-cdns-images.dzcdn.net/images/cover/"
self.artist_pictures_host = "https://e-cdns-images.dzcdn.net/images/artist/" self.artist_pictures_host = "https://e-cdns-images.dzcdn.net/images/artist/"
self.email = ""
self.user = {} self.user = {}
self.family = False self.family = False
self.childs = [] self.childs = []
@ -153,7 +152,6 @@ class Deezer:
'picture': user_data["results"]["USER"]["USER_PICTURE"] if "USER_PICTURE" in user_data["results"][ 'picture': user_data["results"]["USER"]["USER_PICTURE"] if "USER_PICTURE" in user_data["results"][
"USER"] else "" "USER"] else ""
} }
self.email = email
self.logged_in = True self.logged_in = True
return True return True
@ -516,6 +514,29 @@ class Deezer:
result.append(item) result.append(item)
return result return result
def get_all_feedbacks_gw(self, checksums=None):
return self.gw_api_call('user.getAllFeedbacks', {'checksums': checksums})
def add_to_favorites(self, type, id):
if type == 'track':
return self.gw_api_call('favorite_song.add', {'SNG_ID': id})
elif type == 'album':
return self.gw_api_call('album.addFavorite', {'ALB_ID': id})
elif type == 'artist':
return self.gw_api_call('artist.addFavorite', {'ART_ID': id})
elif type == 'playlist':
return self.gw_api_call('playlist.addFavorite', {'PARENT_PLAYLIST_ID': id})
def remove_from_favorites(self, type, id):
if type == 'track':
return self.gw_api_call('favorite_song.remove', {'SNG_ID': id})
elif type == 'album':
return self.gw_api_call('album.deleteFavorite', {'ALB_ID': id})
elif type == 'artist':
return self.gw_api_call('artist.deleteFavorite', {'ART_ID': id})
elif type == 'playlist':
return self.gw_api_call('playlist.deleteFavorite', {'PLAYLIST_ID': id})
def get_user_playlists(self, user_id): def get_user_playlists(self, user_id):
return self.api_call('user/' + str(user_id) + '/playlists', {'limit': -1}) return self.api_call('user/' + str(user_id) + '/playlists', {'limit': -1})

View File

@ -1,6 +1,4 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import eventlet
eventlet.import_patched('requests.__init__')
from deemix.api.deezer import Deezer from deemix.api.deezer import Deezer
from deemix.app.settings import Settings from deemix.app.settings import Settings
from deemix.app.queuemanager import QueueManager from deemix.app.queuemanager import QueueManager

View File

@ -1,10 +1,13 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import eventlet
import json import json
import os.path as path import os.path as path
from os import mkdir from os import mkdir
import spotipy eventlet.import_patched('requests.adapters')
from spotipy.oauth2 import SpotifyClientCredentials
spotipy = eventlet.import_patched('spotipy')
SpotifyClientCredentials = spotipy.oauth2.SpotifyClientCredentials
from deemix.utils.localpaths import getConfigFolder from deemix.utils.localpaths import getConfigFolder
from deemix.app.queueitem import QIConvertable from deemix.app.queueitem import QIConvertable

View File

@ -7,7 +7,7 @@ README = (HERE / "README.md").read_text()
setup( setup(
name="deemix", name="deemix",
version="1.3.8", version="1.3.9",
description="A barebone deezer downloader library", description="A barebone deezer downloader library",
long_description=README, long_description=README,
long_description_content_type="text/markdown", long_description_content_type="text/markdown",