Fixed pyinstaller spotipy issue and started working on favorites
This commit is contained in:
		@ -1,3 +1,3 @@
 | 
			
		||||
#!/usr/bin/env python3
 | 
			
		||||
 | 
			
		||||
__version__ = "1.3.8"
 | 
			
		||||
__version__ = "1.3.9"
 | 
			
		||||
 | 
			
		||||
@ -23,7 +23,6 @@ class Deezer:
 | 
			
		||||
        }
 | 
			
		||||
        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.email = ""
 | 
			
		||||
        self.user = {}
 | 
			
		||||
        self.family = False
 | 
			
		||||
        self.childs = []
 | 
			
		||||
@ -153,7 +152,6 @@ class Deezer:
 | 
			
		||||
                'picture': user_data["results"]["USER"]["USER_PICTURE"] if "USER_PICTURE" in user_data["results"][
 | 
			
		||||
                    "USER"] else ""
 | 
			
		||||
            }
 | 
			
		||||
        self.email = email
 | 
			
		||||
        self.logged_in = True
 | 
			
		||||
        return True
 | 
			
		||||
 | 
			
		||||
@ -516,6 +514,29 @@ class Deezer:
 | 
			
		||||
            result.append(item)
 | 
			
		||||
        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):
 | 
			
		||||
        return self.api_call('user/' + str(user_id) + '/playlists', {'limit': -1})
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,6 +1,4 @@
 | 
			
		||||
#!/usr/bin/env python3
 | 
			
		||||
import eventlet
 | 
			
		||||
eventlet.import_patched('requests.__init__')
 | 
			
		||||
from deemix.api.deezer import Deezer
 | 
			
		||||
from deemix.app.settings import Settings
 | 
			
		||||
from deemix.app.queuemanager import QueueManager
 | 
			
		||||
 | 
			
		||||
@ -1,10 +1,13 @@
 | 
			
		||||
#!/usr/bin/env python3
 | 
			
		||||
import eventlet
 | 
			
		||||
import json
 | 
			
		||||
import os.path as path
 | 
			
		||||
from os import mkdir
 | 
			
		||||
 | 
			
		||||
import spotipy
 | 
			
		||||
from spotipy.oauth2 import SpotifyClientCredentials
 | 
			
		||||
eventlet.import_patched('requests.adapters')
 | 
			
		||||
 | 
			
		||||
spotipy = eventlet.import_patched('spotipy')
 | 
			
		||||
SpotifyClientCredentials = spotipy.oauth2.SpotifyClientCredentials
 | 
			
		||||
from deemix.utils.localpaths import getConfigFolder
 | 
			
		||||
from deemix.app.queueitem import QIConvertable
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user