1
0
mirror of https://github.com/spl0k/supysonic.git synced 2024-12-22 08:56:17 +00:00

Fix api get_entity

This commit is contained in:
mvn23 2019-09-14 22:53:55 +02:00
parent 3e51bf2a6d
commit c3fd94343f

View File

@ -17,6 +17,7 @@ from flask import Blueprint
from pony.orm import ObjectNotFound
from pony.orm import commit
from ..db import Folder
from ..managers.user import UserManager
from ..py23 import dict
@ -82,7 +83,10 @@ def get_client_prefs():
def get_entity(cls, param="id"):
eid = request.values[param]
eid = uuid.UUID(eid)
if cls == Folder:
eid = int(eid)
else:
eid = uuid.UUID(eid)
entity = cls[eid]
return entity