mirror of
https://github.com/spl0k/supysonic.git
synced 2024-12-23 01:16:18 +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())
|
||||||
|
|
||||||
|
if u:
|
||||||
user = User.query.filter(User.name == u).one()
|
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,6 +57,9 @@ class LastFm:
|
|||||||
|
|
||||||
sig_str = ''
|
sig_str = ''
|
||||||
for k, v in sorted(kwargs.iteritems()):
|
for k, v in sorted(kwargs.iteritems()):
|
||||||
|
if type(v) is unicode:
|
||||||
|
sig_str += k + v.encode('utf-8')
|
||||||
|
else:
|
||||||
sig_str += k + str(v)
|
sig_str += k + str(v)
|
||||||
sig = hashlib.md5(sig_str + self.__api_secret).hexdigest()
|
sig = hashlib.md5(sig_str + self.__api_secret).hexdigest()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user