Fix #684: Include shared/public playlists in Subsonic API responses

This commit is contained in:
Eliot Berriot 2019-01-25 12:11:34 +01:00
parent e4954f8bd5
commit cd36128769
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
4 changed files with 41 additions and 17 deletions

View file

@ -18,7 +18,7 @@ def authenticate(username, password):
if password.startswith("enc:"):
password = password.replace("enc:", "", 1)
password = binascii.unhexlify(password).decode("utf-8")
user = User.objects.get(
user = User.objects.select_related("actor").get(
username__iexact=username, is_active=True, subsonic_api_token=password
)
except (User.DoesNotExist, binascii.Error):
@ -29,7 +29,7 @@ def authenticate(username, password):
def authenticate_salt(username, salt, token):
try:
user = User.objects.get(
user = User.objects.select_related("actor").get(
username=username, is_active=True, subsonic_api_token__isnull=False
)
except User.DoesNotExist: