mirror of
https://github.com/spl0k/supysonic.git
synced 2024-12-22 17:06:17 +00:00
Fix LastFM support on tracks with non ASCII info
This commit is contained in:
parent
d5ae79778d
commit
f938e34b0a
@ -87,7 +87,10 @@ def scrobble():
|
|||||||
else:
|
else:
|
||||||
time = int(now())
|
time = int(now())
|
||||||
|
|
||||||
user = User.query.filter(User.name == u).one()
|
if u:
|
||||||
|
user = User.query.filter(User.name == u).one()
|
||||||
|
else:
|
||||||
|
user = User.query.filter(User.name == request.authorization.username).one()
|
||||||
lfm = LastFm(user, app.logger)
|
lfm = LastFm(user, app.logger)
|
||||||
|
|
||||||
if submission in (None, '', True, 'true', 'True', 1, '1'):
|
if submission in (None, '', True, 'true', 'True', 1, '1'):
|
||||||
|
@ -57,7 +57,10 @@ class LastFm:
|
|||||||
|
|
||||||
sig_str = ''
|
sig_str = ''
|
||||||
for k, v in sorted(kwargs.iteritems()):
|
for k, v in sorted(kwargs.iteritems()):
|
||||||
sig_str += k + str(v)
|
if type(v) is unicode:
|
||||||
|
sig_str += k + v.encode('utf-8')
|
||||||
|
else:
|
||||||
|
sig_str += k + str(v)
|
||||||
sig = hashlib.md5(sig_str + self.__api_secret).hexdigest()
|
sig = hashlib.md5(sig_str + self.__api_secret).hexdigest()
|
||||||
|
|
||||||
kwargs['api_sig'] = sig
|
kwargs['api_sig'] = sig
|
||||||
|
Loading…
Reference in New Issue
Block a user